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

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