2021-08-11 21:44:26 +00:00
|
|
|
|
using System.Collections.Generic;
|
2022-02-06 02:11:51 +00:00
|
|
|
|
using HarmonyLib;
|
2021-08-11 21:44:26 +00:00
|
|
|
|
using RobocraftX.Blocks;
|
2022-10-04 23:53:54 +00:00
|
|
|
|
using RobocraftX.Common;
|
|
|
|
|
using RobocraftX.GroupTags;
|
2021-08-11 21:44:26 +00:00
|
|
|
|
using RobocraftX.PilotSeat;
|
2022-10-04 23:53:54 +00:00
|
|
|
|
using Svelto.ECS;
|
2021-08-11 21:44:26 +00:00
|
|
|
|
using Techblox.EngineBlock;
|
2022-06-01 14:54:17 +00:00
|
|
|
|
using Techblox.ServoBlocksServer;
|
2021-08-11 21:44:26 +00:00
|
|
|
|
using Techblox.WheelRigBlock;
|
2021-07-28 22:08:57 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeGenerator
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
2022-10-03 23:47:09 +00:00
|
|
|
|
{
|
2023-10-07 23:55:50 +00:00
|
|
|
|
//GenerateBlockClasses();
|
|
|
|
|
ECSClassGenerator.Generate(typeof(EngineBlockEntityDescriptor));
|
2022-10-03 23:47:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void GenerateBlockClasses()
|
2021-07-28 22:08:57 +00:00
|
|
|
|
{
|
|
|
|
|
var bcg = new BlockClassGenerator();
|
2022-02-06 02:11:51 +00:00
|
|
|
|
bcg.Generate("Engine", null, new Dictionary<string, string>
|
2021-08-11 21:44:26 +00:00
|
|
|
|
{
|
2022-02-06 02:11:51 +00:00
|
|
|
|
{ "engineOn", "On" }
|
|
|
|
|
}, AccessTools.TypeByName("Techblox.EngineBlock.EngineBlockComponent"), // Simulation time properties
|
|
|
|
|
typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent));
|
2021-08-11 21:44:26 +00:00
|
|
|
|
bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{"maxExtent", "MaxExtension"}
|
|
|
|
|
},
|
|
|
|
|
typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct));
|
|
|
|
|
bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP");
|
2022-06-01 14:54:17 +00:00
|
|
|
|
bcg.Generate("Servo", types: typeof(ServoReadOnlyTweakableComponent), renames: new Dictionary<string, string>
|
2021-08-11 21:44:26 +00:00
|
|
|
|
{
|
|
|
|
|
{"minDeviation", "MinimumAngle"},
|
|
|
|
|
{"maxDeviation", "MaximumAngle"},
|
|
|
|
|
{"servoVelocity", "MaximumForce"}
|
|
|
|
|
});
|
|
|
|
|
bcg.Generate("WheelRig", "WHEELRIG_BLOCK_BUILD_GROUP", null,
|
|
|
|
|
typeof(WheelRigTweakableStruct), typeof(WheelRigReadOnlyStruct),
|
|
|
|
|
typeof(WheelRigSteerableTweakableStruct), typeof(WheelRigSteerableReadOnlyStruct));
|
|
|
|
|
bcg.Generate("Seat", "RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP", null, typeof(SeatFollowCamComponent), typeof(SeatReadOnlySettingsComponent));
|
|
|
|
|
bcg.Generate("Piston", null, new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{"pistonVelocity", "MaximumForce"}
|
|
|
|
|
}, typeof(PistonReadOnlyStruct));
|
2021-08-11 22:44:23 +00:00
|
|
|
|
bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct));
|
2022-06-01 14:54:17 +00:00
|
|
|
|
//bcg.Generate("ObjectID", "ObjectIDBlockExclusiveGroups.OBJECT_ID_BLOCK_GROUP", null, typeof(ObjectIDTweakableComponent));
|
2021-07-28 22:08:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|