|
- using System;
-
- using GamecraftModdingAPI.Commands;
-
- namespace ExtraCommands
- {
- [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
- public class CustomCommandAttribute: Attribute
- {
- public readonly string Name;
-
- public readonly string Description;
-
- public readonly bool IsFactory;
-
- public CustomCommandAttribute(string name = "", string description = "", bool factory = false)
- {
- this.Name = name;
- this.Description = description;
- this.IsFactory = factory;
- }
-
- public static bool IsCompatible(Type t)
- {
- foreach (var i in t.GetInterfaces())
- {
- if (i == typeof(ICustomCommandEngine))
- {
- return true;
- }
- }
- return false;
- }
- }
- }
|