Moar Gamecraft commands!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.9KB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using uREPL;
  7. using RobocraftX.CommandLine.Custom;
  8. namespace ExtraCommands
  9. {
  10. static class CustomCommandUtility
  11. {
  12. public static void Register(string name, Action action, string desc)
  13. {
  14. RuntimeCommands.Register(name, action, desc);
  15. ConsoleCommands.Register(name, action, desc);
  16. }
  17. public static void Register(string name, Action<object> action, string desc)
  18. {
  19. RuntimeCommands.Register<object>(name, action, desc);
  20. }
  21. public static void Register<Param0>(string name, Action<Param0> action, string desc)
  22. {
  23. RuntimeCommands.Register<Param0>(name, action, desc);
  24. ConsoleCommands.Register<Param0>(name, action, desc);
  25. }
  26. public static void Register<Param0, Param1>(string name, Action<Param0, Param1> action, string desc)
  27. {
  28. RuntimeCommands.Register<Param0, Param1>(name, action, desc);
  29. ConsoleCommands.Register<Param0, Param1>(name, action, desc);
  30. }
  31. public static void Register(string name, Action<object, object, object> action, string desc)
  32. {
  33. RuntimeCommands.Register<object, object, object>(name, action, desc);
  34. ConsoleCommands.Register<object, object, object>(name, action, desc);
  35. }
  36. public static void Register<Param0, Param1, Param2>(string name, Action<Param0, Param1, Param2> action, string desc)
  37. {
  38. RuntimeCommands.Register<Param0, Param1, Param2>(name, action, desc);
  39. ConsoleCommands.Register<Param0, Param1, Param2>(name, action, desc);
  40. }
  41. public static void Unregister(string name)
  42. {
  43. RuntimeCommands.Unregister(name);
  44. ConsoleCommands.Unregister(name);
  45. }
  46. }
  47. }