A stable modding interface between Techblox and mods https://mod.exmods.org/
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.

76 lines
2.5KB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace TechbloxModdingAPI.Commands
  7. {
  8. /// <summary>
  9. /// Convenient methods for registering commands to Techblox.
  10. /// All methods register to the command line and console block by default.
  11. /// </summary>
  12. public static class CommandRegistrationHelper
  13. {
  14. public static void Register(string name, Action action, string desc, bool noConsole = false)
  15. {
  16. CustomCommands.Register(name, action, desc);
  17. }
  18. public static void Register(string name, Action<object> action, string desc, bool noConsole = false)
  19. {
  20. Register<object>(name, action, desc, noConsole);
  21. }
  22. public static void Register(string name, Action<object, object> action, string desc, bool noConsole = false)
  23. {
  24. Register<object, object>(name, action, desc, noConsole);
  25. }
  26. public static void Register(string name, Action<object, object, object> action, string desc, bool noConsole = false)
  27. {
  28. Register<object, object, object>(name, action, desc, noConsole);
  29. }
  30. public static void Register<Param0>(string name, Action<Param0> action, string desc, bool noConsole = false)
  31. {
  32. CustomCommands.Register(name, action, desc);
  33. }
  34. public static void Register<Param0, Param1>(string name, Action<Param0, Param1> action, string desc, bool noConsole = false)
  35. {
  36. CustomCommands.Register(name, action, desc);
  37. }
  38. public static void Register<Param0, Param1, Param2>(string name, Action<Param0, Param1, Param2> action, string desc, bool noConsole = false)
  39. {
  40. CustomCommands.Register(name, action, desc);
  41. }
  42. public static void Unregister(string name, bool noConsole = false)
  43. {
  44. CustomCommands.Unregister(name);
  45. }
  46. public static void Call(string name)
  47. {
  48. CustomCommands.Call(name);
  49. }
  50. public static void Call<Param0>(string name, Param0 param0)
  51. {
  52. CustomCommands.Call(name, param0);
  53. }
  54. public static void Call<Param0, Param1>(string name, Param0 param0, Param1 param1)
  55. {
  56. CustomCommands.Call(name, param0, param1);
  57. }
  58. public static void Call<Param0, Param1, Param2>(string name, Param0 param0, Param1 param1, Param2 param2)
  59. {
  60. CustomCommands.Call(name, param0, param1, param2);
  61. }
  62. }
  63. }