Moar Gamecraft commands!
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

36 строки
806B

  1. using System;
  2. using GamecraftModdingAPI.Commands;
  3. namespace ExtraCommands
  4. {
  5. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
  6. public class CustomCommandAttribute: Attribute
  7. {
  8. public readonly string Name;
  9. public readonly string Description;
  10. public readonly bool IsFactory;
  11. public CustomCommandAttribute(string name = "", string description = "", bool factory = false)
  12. {
  13. this.Name = name;
  14. this.Description = description;
  15. this.IsFactory = factory;
  16. }
  17. public static bool IsCompatible(Type t)
  18. {
  19. foreach (var i in t.GetInterfaces())
  20. {
  21. if (i == typeof(ICustomCommandEngine))
  22. {
  23. return true;
  24. }
  25. }
  26. return false;
  27. }
  28. }
  29. }