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.

53 lines
2.3KB

  1. using System.Collections.Generic;
  2. using HarmonyLib;
  3. using RobocraftX.Blocks;
  4. using RobocraftX.Common;
  5. using RobocraftX.GroupTags;
  6. using RobocraftX.PilotSeat;
  7. using Svelto.ECS;
  8. using Techblox.EngineBlock;
  9. using Techblox.ServoBlocksServer;
  10. using Techblox.WheelRigBlock;
  11. namespace CodeGenerator
  12. {
  13. internal class Program
  14. {
  15. public static void Main(string[] args)
  16. {
  17. GenerateBlockClasses();
  18. }
  19. private static void GenerateBlockClasses()
  20. {
  21. var bcg = new BlockClassGenerator();
  22. bcg.Generate("Engine", null, new Dictionary<string, string>
  23. {
  24. { "engineOn", "On" }
  25. }, AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), // Simulation time properties
  26. typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent));
  27. bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary<string, string>
  28. {
  29. {"maxExtent", "MaxExtension"}
  30. },
  31. typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct));
  32. bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP");
  33. bcg.Generate("Servo", types: typeof(ServoReadOnlyTweakableComponent), renames: new Dictionary<string, string>
  34. {
  35. {"minDeviation", "MinimumAngle"},
  36. {"maxDeviation", "MaximumAngle"},
  37. {"servoVelocity", "MaximumForce"}
  38. });
  39. bcg.Generate("WheelRig", "WHEELRIG_BLOCK_BUILD_GROUP", null,
  40. typeof(WheelRigTweakableStruct), typeof(WheelRigReadOnlyStruct),
  41. typeof(WheelRigSteerableTweakableStruct), typeof(WheelRigSteerableReadOnlyStruct));
  42. bcg.Generate("Seat", "RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP", null, typeof(SeatFollowCamComponent), typeof(SeatReadOnlySettingsComponent));
  43. bcg.Generate("Piston", null, new Dictionary<string, string>
  44. {
  45. {"pistonVelocity", "MaximumForce"}
  46. }, typeof(PistonReadOnlyStruct));
  47. bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct));
  48. //bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent));
  49. }
  50. }
  51. }