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
1.6KB

  1. using System;
  2. using RobocraftX.Blocks;
  3. using RobocraftX.Common;
  4. using Svelto.ECS;
  5. using Unity.Mathematics;
  6. using GamecraftModdingAPI;
  7. using GamecraftModdingAPI.Utility;
  8. namespace GamecraftModdingAPI.Blocks
  9. {
  10. public class ConsoleBlock : Block
  11. {
  12. public ConsoleBlock(EGID id): base(id)
  13. {
  14. }
  15. public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP))
  16. {
  17. }
  18. // custom console block properties
  19. /// <summary>
  20. /// Setting a nonexistent command will crash the game when switching to simulation
  21. /// </summary>
  22. public string Command
  23. {
  24. get
  25. {
  26. return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName);
  27. }
  28. set
  29. {
  30. BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val),
  31. value);
  32. }
  33. }
  34. public string Arg1
  35. {
  36. get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1);
  37. set
  38. {
  39. BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val),
  40. value);
  41. }
  42. }
  43. public string Arg2
  44. {
  45. get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2);
  46. set
  47. {
  48. BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val),
  49. value);
  50. }
  51. }
  52. public string Arg3
  53. {
  54. get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3);
  55. set
  56. {
  57. BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val),
  58. value);
  59. }
  60. }
  61. }
  62. }