diff options
Diffstat (limited to 'Impostor-dev/src/Impostor.Server/Plugins/PluginInformation.cs')
-rw-r--r-- | Impostor-dev/src/Impostor.Server/Plugins/PluginInformation.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Impostor-dev/src/Impostor.Server/Plugins/PluginInformation.cs b/Impostor-dev/src/Impostor.Server/Plugins/PluginInformation.cs new file mode 100644 index 0000000..e6a5b6c --- /dev/null +++ b/Impostor-dev/src/Impostor.Server/Plugins/PluginInformation.cs @@ -0,0 +1,38 @@ +using System; +using System.Reflection; +using Impostor.Api.Plugins; + +namespace Impostor.Server.Plugins +{ + public class PluginInformation + { + private readonly ImpostorPluginAttribute _attribute; + + public PluginInformation(IPluginStartup startup, Type pluginType) + { + _attribute = pluginType.GetCustomAttribute<ImpostorPluginAttribute>(); + + Startup = startup; + PluginType = pluginType; + } + + public string Package => _attribute.Package; + + public string Name => _attribute.Name; + + public string Author => _attribute.Author; + + public string Version => _attribute.Version; + + public IPluginStartup Startup { get; } + + public Type PluginType { get; } + + public IPlugin Instance { get; set; } + + public override string ToString() + { + return $"{Package} {Name} ({Version}) by {Author}"; + } + } +}
\ No newline at end of file |