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.

43 lines
1013B

  1. using System;
  2. using uREPL;
  3. namespace GamecraftModdingAPI.Commands
  4. {
  5. public static class ExistingCommands
  6. {
  7. public static void Call(string commandName)
  8. {
  9. RuntimeCommands.Call(commandName);
  10. }
  11. public static void Call<Arg0>(string commandName, Arg0 arg0)
  12. {
  13. RuntimeCommands.Call<Arg0>(commandName, arg0);
  14. }
  15. public static void Call<Arg0, Arg1>(string commandName, Arg0 arg0, Arg1 arg1)
  16. {
  17. RuntimeCommands.Call<Arg0, Arg1>(commandName, arg0, arg1);
  18. }
  19. public static void Call<Arg0, Arg1, Arg2>(string commandName, Arg0 arg0, Arg1 arg1, Arg2 arg2)
  20. {
  21. RuntimeCommands.Call<Arg0, Arg1, Arg2>(commandName, arg0, arg1, arg2);
  22. }
  23. public static bool Exists(string commandName)
  24. {
  25. return RuntimeCommands.HasRegistered(commandName);
  26. }
  27. public static string[] GetCommandNames()
  28. {
  29. var keys = RuntimeCommands.table.Keys;
  30. string[] res = new string[keys.Count];
  31. keys.CopyTo(res, 0);
  32. return res;
  33. }
  34. }
  35. }