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.

Program.cs 1.9KB

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