Moar Gamecraft commands!
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
805B

  1. using System;
  2. using GamecraftModdingAPI.Commands;
  3. namespace ExtraCommands
  4. {
  5. [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
  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. }