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.

45 lines
2.1KB

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