// Copyright Epic Games, Inc. All Rights Reserved.
namespace HordeServer.Plugins
{
///
/// Attribute used to identify types that should be constructed for the given plugin name. Should be attached to a public class implementing
/// .
///
[AttributeUsage(AttributeTargets.Class)]
public sealed class PluginAttribute : Attribute
{
///
/// Name of the plugin
///
public string Name { get; }
///
/// Whether the plugin should be enabled by default
///
public bool EnabledByDefault { get; set; } = true;
///
/// Other plugins that this plugin depends on
///
public string[] DependsOn { get; set; } = [];
///
/// Type containing server settings for this plugin. Will be injected into a
/// object in the service container, as well as (optionally) the constructor for the the concrete plugin startup object.
///
public Type? ServerConfigType { get; set; }
///
/// Type containing global settings for this plugin. Must implement the interface.
///
/// Standard and
/// objects will be registered for this type
/// in the service container.
///
public Type? GlobalConfigType { get; set; }
///
/// Constructor
///
public PluginAttribute(string name)
=> Name = name;
}
}