From 49c3b60963e499263e7695b830ca1689051deaa0 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Jul 2021 00:08:57 +0200 Subject: [PATCH 1/5] Get wire looked at, block class generation --- CodeGenerator/BlockClassGenerator.cs | 68 + CodeGenerator/CodeGenerator.csproj | 1176 +++++++++++++++++ CodeGenerator/Program.cs | 16 + CodeGenerator/Properties/AssemblyInfo.cs | 35 + TechbloxModdingAPI.sln | 8 + TechbloxModdingAPI/App/GameGameEngine.cs | 2 - TechbloxModdingAPI/Blocks/LogicGate.cs | 16 + TechbloxModdingAPI/Blocks/Piston.cs | 50 + TechbloxModdingAPI/Blocks/Servo.cs | 71 + TechbloxModdingAPI/Player.cs | 17 +- .../Tests/TechbloxModdingAPIPluginTest.cs | 15 + 11 files changed, 1471 insertions(+), 3 deletions(-) create mode 100644 CodeGenerator/BlockClassGenerator.cs create mode 100644 CodeGenerator/CodeGenerator.csproj create mode 100644 CodeGenerator/Program.cs create mode 100644 CodeGenerator/Properties/AssemblyInfo.cs create mode 100644 TechbloxModdingAPI/Blocks/LogicGate.cs create mode 100644 TechbloxModdingAPI/Blocks/Piston.cs create mode 100644 TechbloxModdingAPI/Blocks/Servo.cs diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs new file mode 100644 index 0000000..82c3206 --- /dev/null +++ b/CodeGenerator/BlockClassGenerator.cs @@ -0,0 +1,68 @@ +using System.CodeDom; +using System.CodeDom.Compiler; +using System.IO; +using System.Linq; +using RobocraftX.Common; + +namespace CodeGenerator +{ + public class BlockClassGenerator + { + public void Generate(string name, string group) + { + if (group is null) + { + group = GetGroup(name) + "_BLOCK_GROUP"; + if (typeof(CommonExclusiveGroups).GetFields().All(field => field.Name != group)) + group = GetGroup(name) + "_BLOCK_BUILD_GROUP"; + } + + var codeUnit = new CodeCompileUnit(); + var ns = new CodeNamespace("TechbloxModdingAPI.Blocks"); + ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); + ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); + var cl = new CodeTypeDeclaration(name); + cl.Members.Add(new CodeConstructor + { + Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, + Comments = { new CodeCommentStatement($"{name} constructor", true)} + }); + cl.Members.Add(new CodeConstructor + { + Parameters = + { + new CodeParameterDeclarationExpression(typeof(uint), "id") + }, + Comments = {new CodeCommentStatement($"{name} constructor", true)}, + BaseConstructorArgs = + { + new CodeObjectCreateExpression("EGID", new CodeVariableReferenceExpression("id"), + new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("CommonExclusiveGroups"), + group)) + } + }); + ns.Types.Add(cl); + codeUnit.Namespaces.Add(ns); + + var provider = CodeDomProvider.CreateProvider("CSharp"); + using (var sw = new StreamWriter($"{name}.cs")) + { + provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); + } + } + + private static string GetGroup(string name) + { + var ret = ""; + foreach (var ch in name) + { + if (char.IsUpper(ch) && ret.Length > 0) + ret += "_" + ch; + else + ret += char.ToUpper(ch); + } + + return ret; + } + } +} \ No newline at end of file diff --git a/CodeGenerator/CodeGenerator.csproj b/CodeGenerator/CodeGenerator.csproj new file mode 100644 index 0000000..826623c --- /dev/null +++ b/CodeGenerator/CodeGenerator.csproj @@ -0,0 +1,1176 @@ + + + + + Debug + AnyCPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10} + Exe + Properties + CodeGenerator + CodeGenerator + v4.7.2 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + ..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionInjector.dll + + + ..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + ..\..\ref\TechbloxPreview_Data\Managed\IllusionPlugin.dll + + + ..\ref\TechbloxPreview_Data\Managed\Analytics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Analytics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + ..\..\ref\TechbloxPreview_Data\Managed\Assembly-CSharp.dll + + + ..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + ..\..\ref\TechbloxPreview_Data\Managed\BevelEffect.dll + + + ..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.TheVehetationEngine.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + ..\..\ref\TechbloxPreview_Data\Managed\Boxophobic.Utils.Scripts.dll + + + ..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + ..\..\ref\TechbloxPreview_Data\Managed\DataLoader.dll + + + ..\ref\TechbloxPreview_Data\Managed\DDNA.dll + ..\..\ref\TechbloxPreview_Data\Managed\DDNA.dll + + + ..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + ..\..\ref\TechbloxPreview_Data\Managed\EOSSDK.dll + + + ..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnity.dll + + + ..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + ..\..\ref\TechbloxPreview_Data\Managed\FMODUnityResonance.dll + + + ..\ref\TechbloxPreview_Data\Managed\FullGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\FullGame.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.AudioBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlockGroups.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ColourPalette.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Damage.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Effects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.ExplosionFragments.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GraphicsSettings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.BlueprintsHotbar.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.JointBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Music.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.NetStrings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupBlck.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PickupsCommon.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.PopupMessage.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Projectiles.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.VisualEffects.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.dll + + + ..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + ..\..\ref\TechbloxPreview_Data\Managed\Gamecraft.Wires.Mockup.dll + + + ..\ref\TechbloxPreview_Data\Managed\GameState.dll + ..\..\ref\TechbloxPreview_Data\Managed\GameState.dll + + + ..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + ..\..\ref\TechbloxPreview_Data\Managed\GhostShark.Outline.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.CrowdAnimations.dll + + + ..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + ..\..\ref\TechbloxPreview_Data\Managed\GPUInstancer.dll + + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\JWT.dll + ..\..\ref\TechbloxPreview_Data\Managed\JWT.dll + + + ..\ref\TechbloxPreview_Data\Managed\LZ4.dll + ..\..\ref\TechbloxPreview_Data\Managed\LZ4.dll + + + ..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + ..\..\ref\TechbloxPreview_Data\Managed\mscorlib.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerNetworking.dll + + + ..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + ..\..\ref\TechbloxPreview_Data\Managed\MultiplayerTest.dll + + + ..\ref\TechbloxPreview_Data\Managed\netstandard.dll + ..\..\ref\TechbloxPreview_Data\Managed\netstandard.dll + + + ..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + ..\..\ref\TechbloxPreview_Data\Managed\Newtonsoft.Json.dll + + + ..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + ..\..\ref\TechbloxPreview_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Core.dll + + + ..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + ..\..\ref\TechbloxPreview_Data\Managed\Rewired_Windows.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Building.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Character.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Crosshair.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.Inventory.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.PauseMenu.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Input.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainGame.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MockCharacter.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Multiplayer.Serializers.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.ObjectIdBlocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Party.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Player.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.SpawnPoints.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX.StateSync.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocraftX_TextBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + ..\..\ref\TechbloxPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll + + + ..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + ..\..\ref\TechbloxPreview_Data\Managed\SpecializedDescriptors.dll + + + ..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + ..\..\ref\TechbloxPreview_Data\Managed\StringFormatter.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.ECS.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Services.dll + + + ..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Svelto.Tasks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.AutoForward.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Backend.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Building.Rules.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.BuildingDrone.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Camera.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.ContextSensitiveTextHint.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.EngineBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Environment.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Building.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.BuildRules.MockUps.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Hotbar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Inventory.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Login.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.MyGamesScreen.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.Notifications.MockUps.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.GUI.TabsBar.Materials.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.InputCapture.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Pointer.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SaveGamesConversion.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.Services.Eos.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.SwitchAnimation.dll + + + ..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + ..\..\ref\TechbloxPreview_Data\Managed\Techblox.WheelRigBlock.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Addressables.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.DOTween.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.Linq.dll + + + ..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\UniTask.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Addressables.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Mdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Pdb.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Cecil.Rocks.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Deformations.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.InternalAPIEngineBridge.012.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Jobs.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.MemoryProfiler.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Platforms.Common.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.Reflection.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Properties.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.Base.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Recorder.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Config.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.HighDefinition.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ResourceManager.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Scenes.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Serialization.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.TextMeshPro.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Timeline.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + ..\..\ref\TechbloxPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ARModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.AudioModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClothModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.GridModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.InputModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.SubsystemsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.TLSModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UI.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UIModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UNETModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityCurlModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VFXModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VideoModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.VRModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.WindModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + ..\..\ref\TechbloxPreview_Data\Managed\UnityEngine.XRModule.dll + + + ..\ref\TechbloxPreview_Data\Managed\uREPL.dll + ..\..\ref\TechbloxPreview_Data\Managed\uREPL.dll + + + ..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + ..\..\ref\TechbloxPreview_Data\Managed\VisualProfiler.dll + + + + + + diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs new file mode 100644 index 0000000..15a7e1c --- /dev/null +++ b/CodeGenerator/Program.cs @@ -0,0 +1,16 @@ +using System.CodeDom; +using System.CodeDom.Compiler; +using System.IO; + +namespace CodeGenerator +{ + internal class Program + { + public static void Main(string[] args) + { + var bcg = new BlockClassGenerator(); + bcg.Generate("TestBlock", "TEST_BLOCK"); + bcg.Generate("Engine", null); + } + } +} \ No newline at end of file diff --git a/CodeGenerator/Properties/AssemblyInfo.cs b/CodeGenerator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..18681a4 --- /dev/null +++ b/CodeGenerator/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CodeGenerator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CodeGenerator")] +[assembly: AssemblyCopyright("Copyright © ExMods 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0EBB6400-95A7-4A3D-B2ED-BF31E364CC10")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/TechbloxModdingAPI.sln b/TechbloxModdingAPI.sln index 2191746..999cac5 100644 --- a/TechbloxModdingAPI.sln +++ b/TechbloxModdingAPI.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.29411.108 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechbloxModdingAPI", "TechbloxModdingAPI\TechbloxModdingAPI.csproj", "{7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeGenerator", "CodeGenerator\CodeGenerator.csproj", "{0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,6 +20,12 @@ Global {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Release|Any CPU.Build.0 = Release|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.ActiveCfg = Test|Any CPU {7FD5A7D8-4F3E-426A-B07D-7DC70442A4DF}.Test|Any CPU.Build.0 = Test|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Release|Any CPU.Build.0 = Release|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.ActiveCfg = Debug|Any CPU + {0EBB6400-95A7-4A3D-B2ED-BF31E364CC10}.Test|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TechbloxModdingAPI/App/GameGameEngine.cs b/TechbloxModdingAPI/App/GameGameEngine.cs index 51c53c8..8ae2aa3 100644 --- a/TechbloxModdingAPI/App/GameGameEngine.cs +++ b/TechbloxModdingAPI/App/GameGameEngine.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using HarmonyLib; -using RobocraftX; using RobocraftX.Common; using RobocraftX.Schedulers; using RobocraftX.SimulationModeState; diff --git a/TechbloxModdingAPI/Blocks/LogicGate.cs b/TechbloxModdingAPI/Blocks/LogicGate.cs new file mode 100644 index 0000000..50a819c --- /dev/null +++ b/TechbloxModdingAPI/Blocks/LogicGate.cs @@ -0,0 +1,16 @@ +using RobocraftX.Common; +using Svelto.ECS; + +namespace TechbloxModdingAPI.Blocks +{ + public class LogicGate : SignalingBlock + { + public LogicGate(EGID id) : base(id) + { + } + + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) + { + } + } +} \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs new file mode 100644 index 0000000..22ee052 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -0,0 +1,50 @@ +using System; + +using RobocraftX.Blocks; +using Svelto.ECS; +using Unity.Mathematics; + +using TechbloxModdingAPI.Utility; +using RobocraftX.Common; + +namespace TechbloxModdingAPI.Blocks +{ + public class Piston : SignalingBlock + { + public Piston(EGID id) : base(id) + { + } + + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) + { + } + + // custom piston properties + + /// + /// The piston's max extension distance. + /// + public float MaximumExtension + { + get => BlockEngine.GetBlockInfo(this).maxDeviation; + + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// The piston's max extension force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(this).pistonVelocity; + + set + { + BlockEngine.GetBlockInfo(this).pistonVelocity = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs new file mode 100644 index 0000000..613ab65 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -0,0 +1,71 @@ +using RobocraftX.Blocks; +using RobocraftX.Common; +using Svelto.ECS; + +namespace TechbloxModdingAPI.Blocks +{ + public class Servo : SignalingBlock + { + public Servo(EGID id) : base(id) + { + } + + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) + { + } + + // custom servo properties + + /// + /// The servo's minimum angle. + /// + public float MinimumAngle + { + get => BlockEngine.GetBlockInfo(this).minDeviation; + + set + { + BlockEngine.GetBlockInfo(this).minDeviation = value; + } + } + + /// + /// The servo's maximum angle. + /// + public float MaximumAngle + { + get => BlockEngine.GetBlockInfo(this).maxDeviation; + + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// The servo's maximum force. + /// + public float MaximumForce + { + get => BlockEngine.GetBlockInfo(this).servoVelocity; + + set + { + BlockEngine.GetBlockInfo(this).servoVelocity = value; + } + } + + /// + /// The servo's direction. + /// + public bool Reverse + { + get => BlockEngine.GetBlockInfo(this).reverse; + + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Player.cs b/TechbloxModdingAPI/Player.cs index de38b9b..811056e 100644 --- a/TechbloxModdingAPI/Player.cs +++ b/TechbloxModdingAPI/Player.cs @@ -4,6 +4,7 @@ using RobocraftX.Character.Movement; using Unity.Mathematics; using RobocraftX.Common; using RobocraftX.Common.Players; +using RobocraftX.GUI.Wires; using RobocraftX.Physics; using Svelto.ECS; using Techblox.BuildingDrone; @@ -432,8 +433,9 @@ namespace TechbloxModdingAPI { var egid = playerEngine.GetThingLookedAt(Id, maxDistance); return egid != EGID.Empty && egid.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP + && egid.groupID != WiresGUIExclusiveGroups.WireGroup ? Block.New(egid) - : null; + : null; } /// @@ -449,6 +451,19 @@ namespace TechbloxModdingAPI : null; } + /// + /// Returns the wire the player is currently looking at in build mode. + /// + /// The maximum distance from the player (default is the player's building reach) + /// The wire or null if not found + public Wire GetWireLookedAt(float maxDistance = -1f) + { + var egid = playerEngine.GetThingLookedAt(Id, maxDistance); + return egid != EGID.Empty && egid.groupID == WiresGUIExclusiveGroups.WireGroup + ? new Wire(egid) + : null; + } + /// /// Returns the blocks that are in the player's current selection. /// diff --git a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs index b98990b..eb9bda4 100644 --- a/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs +++ b/TechbloxModdingAPI/Tests/TechbloxModdingAPIPluginTest.cs @@ -312,6 +312,21 @@ namespace TechbloxModdingAPI.Tests Loop().RunOn(Scheduler.leanRunner); }).Build(); + + CommandBuilder.Builder("importAssetBundle") + .Action(() => + { + Logging.CommandLog("Importing asset bundle..."); + var ab = AssetBundle.LoadFromFile( + @"filepath"); + Logging.CommandLog("Imported asset bundle: " + ab); + var assets = ab.LoadAllAssets(); + Logging.CommandLog("Loaded " + assets.Length + " assets"); + foreach (var asset in assets) + { + Logging.CommandLog(asset); + } + }).Build(); #if TEST TestRoot.RunTests(); #endif From 3351993936877391a61fab47f1ad7bdf3c3e0b9e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 29 Jul 2021 01:04:27 +0200 Subject: [PATCH 2/5] Automatically generate properties, fixes, engine class --- CodeGenerator/BlockClassGenerator.cs | 35 ++++- TechbloxModdingAPI/Blocks/Engine.cs | 217 ++++++++++++++++++++++++--- 2 files changed, 231 insertions(+), 21 deletions(-) diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index 82c3206..5a2e748 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -3,6 +3,8 @@ using System.CodeDom.Compiler; using System.IO; using System.Linq; using RobocraftX.Common; +using Svelto.ECS; +using Techblox.EngineBlock; namespace CodeGenerator { @@ -22,10 +24,12 @@ namespace CodeGenerator ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); var cl = new CodeTypeDeclaration(name); + cl.BaseTypes.Add(new CodeTypeReference("Block")); cl.Members.Add(new CodeConstructor { Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, - Comments = { new CodeCommentStatement($"{name} constructor", true)} + Comments = {new CodeCommentStatement($"{name} constructor", true)}, + BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")} }); cl.Members.Add(new CodeConstructor { @@ -41,6 +45,7 @@ namespace CodeGenerator group)) } }); + GenerateProperties(cl); ns.Types.Add(cl); codeUnit.Namespaces.Add(ns); @@ -64,5 +69,33 @@ namespace CodeGenerator return ret; } + + private void GenerateProperties(CodeTypeDeclaration cl) where T : IEntityComponent + { + var type = typeof(T); + foreach (var field in type.GetFields()) + { + var propName = char.ToUpper(field.Name[0]) + field.Name.Substring(1); + var structFieldReference = new CodeFieldReferenceExpression(new CodeMethodInvokeExpression( + new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), + "GetBlockInfo", new CodeTypeReference(type)), + new CodeThisReferenceExpression()), field.Name); + cl.Members.Add(new CodeMemberProperty + { + Name = propName, + HasGet = true, + HasSet = true, + GetStatements = + { + new CodeMethodReturnStatement(structFieldReference) + }, + SetStatements = + { + new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) + }, + Type = new CodeTypeReference(field.FieldType) + }); + } + } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 08a8f33..05c09e6 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -1,35 +1,212 @@ -using RobocraftX.Common; -using Svelto.ECS; -using Techblox.EngineBlock; +//------------------------------------------------------------------------------ +// +// Ezt a kódot eszköz generálta. +// Futásidejű verzió:4.0.30319.42000 +// +// Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha +// a kódot újragenerálják. +// +//------------------------------------------------------------------------------ namespace TechbloxModdingAPI.Blocks { - public class Engine : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Engine : Block { - public Engine(EGID id) : base(id) + + /// Engine constructor + private Engine(EGID egid) : + base(egid) { } - - public Engine(uint id) : base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) + + /// Engine constructor + private Engine(uint id) : + base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) { } - - public bool On + + private bool EngineOn { - get => BlockEngine.GetBlockInfo(this).engineOn; - set => BlockEngine.GetBlockInfo(this).engineOn = value; + get + { + return BlockEngine.GetBlockInfo(this).engineOn; + } + set + { + BlockEngine.GetBlockInfo(this).engineOn = value; + } } - - public float CurrentTorque + + private int CurrentGear { - get => BlockEngine.GetBlockInfo(this).currentTorque; - set => BlockEngine.GetBlockInfo(this).currentTorque = value; + get + { + return BlockEngine.GetBlockInfo(this).currentGear; + } + set + { + BlockEngine.GetBlockInfo(this).currentGear = value; + } } - - public int CurrentGear + + private float GearChangeCountdown + { + get + { + return BlockEngine.GetBlockInfo(this).gearChangeCountdown; + } + set + { + BlockEngine.GetBlockInfo(this).gearChangeCountdown = value; + } + } + + private float CurrentRpmAV + { + get + { + return BlockEngine.GetBlockInfo(this).currentRpmAV; + } + set + { + BlockEngine.GetBlockInfo(this).currentRpmAV = value; + } + } + + private float CurrentRpmLV + { + get + { + return BlockEngine.GetBlockInfo(this).currentRpmLV; + } + set + { + BlockEngine.GetBlockInfo(this).currentRpmLV = value; + } + } + + private float TargetRpmAV + { + get + { + return BlockEngine.GetBlockInfo(this).targetRpmAV; + } + set + { + BlockEngine.GetBlockInfo(this).targetRpmAV = value; + } + } + + private float TargetRpmLV + { + get + { + return BlockEngine.GetBlockInfo(this).targetRpmLV; + } + set + { + BlockEngine.GetBlockInfo(this).targetRpmLV = value; + } + } + + private float CurrentTorque + { + get + { + return BlockEngine.GetBlockInfo(this).currentTorque; + } + set + { + BlockEngine.GetBlockInfo(this).currentTorque = value; + } + } + + private float TotalWheelVelocityAV + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelVelocityAV; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelVelocityAV = value; + } + } + + private float TotalWheelVelocityLV + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelVelocityLV; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelVelocityLV = value; + } + } + + private int TotalWheelCount + { + get + { + return BlockEngine.GetBlockInfo(this).totalWheelCount; + } + set + { + BlockEngine.GetBlockInfo(this).totalWheelCount = value; + } + } + + private bool LastGearUpInput + { + get + { + return BlockEngine.GetBlockInfo(this).lastGearUpInput; + } + set + { + BlockEngine.GetBlockInfo(this).lastGearUpInput = value; + } + } + + private bool LastGearDownInput + { + get + { + return BlockEngine.GetBlockInfo(this).lastGearDownInput; + } + set + { + BlockEngine.GetBlockInfo(this).lastGearDownInput = value; + } + } + + private float ManualToAutoGearCoolOffCounter + { + get + { + return BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter; + } + set + { + BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffCounter = value; + } + } + + private float Load { - get => BlockEngine.GetBlockInfo(this).currentGear; - set => BlockEngine.GetBlockInfo(this).currentGear = value; + get + { + return BlockEngine.GetBlockInfo(this).load; + } + set + { + BlockEngine.GetBlockInfo(this).load = value; + } } } -} \ No newline at end of file +} From c0eae774212f18708822359795165dc7d3eab917 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 11 Aug 2021 23:44:26 +0200 Subject: [PATCH 3/5] Finish code generator (mostly) Made the generated members public and final Removed the comment from the start of the files Generating the files directly into the project folder Added comments describing the generated constructors and properties Using SignalingBlock as a base class Added support for renaming properties Added support for getting the name from the tweakable stat name Added/updated functional block classes --- CodeGenerator/BlockClassGenerator.cs | 69 ++++-- CodeGenerator/Program.cs | 35 ++- TechbloxModdingAPI/Blocks/DampedSpring.cs | 72 ++++--- TechbloxModdingAPI/Blocks/Engine.cs | 249 +++++++++++++++++++--- TechbloxModdingAPI/Blocks/LogicGate.cs | 24 ++- TechbloxModdingAPI/Blocks/Piston.cs | 87 +++++--- TechbloxModdingAPI/Blocks/Seat.cs | 56 +++++ TechbloxModdingAPI/Blocks/Servo.cs | 171 ++++++++++----- TechbloxModdingAPI/Blocks/WheelRig.cs | 101 +++++++++ TechbloxModdingAPI/Utility/OptionalRef.cs | 1 - 10 files changed, 703 insertions(+), 162 deletions(-) create mode 100644 TechbloxModdingAPI/Blocks/Seat.cs create mode 100644 TechbloxModdingAPI/Blocks/WheelRig.cs diff --git a/CodeGenerator/BlockClassGenerator.cs b/CodeGenerator/BlockClassGenerator.cs index 5a2e748..c2307a0 100644 --- a/CodeGenerator/BlockClassGenerator.cs +++ b/CodeGenerator/BlockClassGenerator.cs @@ -1,7 +1,11 @@ +using System; using System.CodeDom; using System.CodeDom.Compiler; +using System.Collections.Generic; using System.IO; using System.Linq; +using System.Reflection; +using Gamecraft.Tweaks; using RobocraftX.Common; using Svelto.ECS; using Techblox.EngineBlock; @@ -10,7 +14,7 @@ namespace CodeGenerator { public class BlockClassGenerator { - public void Generate(string name, string group) + public void Generate(string name, string group = null, Dictionary renames = null, params Type[] types) { if (group is null) { @@ -19,17 +23,25 @@ namespace CodeGenerator group = GetGroup(name) + "_BLOCK_BUILD_GROUP"; } + if (!group.Contains(".")) + group = "CommonExclusiveGroups." + group; + var codeUnit = new CodeCompileUnit(); var ns = new CodeNamespace("TechbloxModdingAPI.Blocks"); ns.Imports.Add(new CodeNamespaceImport("RobocraftX.Common")); ns.Imports.Add(new CodeNamespaceImport("Svelto.ECS")); var cl = new CodeTypeDeclaration(name); - cl.BaseTypes.Add(new CodeTypeReference("Block")); + //cl.BaseTypes.Add(baseClass != null ? new CodeTypeReference(baseClass) : new CodeTypeReference("Block")); + cl.BaseTypes.Add(new CodeTypeReference("SignalingBlock")); cl.Members.Add(new CodeConstructor { Parameters = {new CodeParameterDeclarationExpression("EGID", "egid")}, - Comments = {new CodeCommentStatement($"{name} constructor", true)}, - BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")} + Comments = + { + _start, new CodeCommentStatement($"Constructs a(n) {name} object representing an existing block.", true), _end + }, + BaseConstructorArgs = {new CodeVariableReferenceExpression("egid")}, + Attributes = MemberAttributes.Public | MemberAttributes.Final }); cl.Members.Add(new CodeConstructor { @@ -37,23 +49,33 @@ namespace CodeGenerator { new CodeParameterDeclarationExpression(typeof(uint), "id") }, - Comments = {new CodeCommentStatement($"{name} constructor", true)}, + Comments = + { + _start, new CodeCommentStatement($"Constructs a(n) {name} object representing an existing block.", true), _end + }, BaseConstructorArgs = { new CodeObjectCreateExpression("EGID", new CodeVariableReferenceExpression("id"), - new CodeFieldReferenceExpression(new CodeTypeReferenceExpression("CommonExclusiveGroups"), - group)) - } + new CodeVariableReferenceExpression(group)) + }, + Attributes = MemberAttributes.Public | MemberAttributes.Final }); - GenerateProperties(cl); + foreach (var type in types) + { + GenerateProperties(cl, type, name, renames); + } ns.Types.Add(cl); codeUnit.Namespaces.Add(ns); var provider = CodeDomProvider.CreateProvider("CSharp"); - using (var sw = new StreamWriter($"{name}.cs")) + var path = $@"..\..\..\TechbloxModdingAPI\Blocks\{name}.cs"; + using (var sw = new StreamWriter(path)) { provider.GenerateCodeFromCompileUnit(codeUnit, sw, new CodeGeneratorOptions {BracingStyle = "C"}); } + + File.WriteAllLines(path, + File.ReadAllLines(path).SkipWhile(line => line.StartsWith("//") || line.Length == 0)); } private static string GetGroup(string name) @@ -70,12 +92,22 @@ namespace CodeGenerator return ret; } - private void GenerateProperties(CodeTypeDeclaration cl) where T : IEntityComponent + private void GenerateProperties(CodeTypeDeclaration cl, Type type, string baseClass, + Dictionary renames) { - var type = typeof(T); + if (!typeof(IEntityComponent).IsAssignableFrom(type)) + throw new ArgumentException("Type must be an entity component"); foreach (var field in type.GetFields()) { - var propName = char.ToUpper(field.Name[0]) + field.Name.Substring(1); + var attr = field.GetCustomAttribute(); + if (renames == null || !renames.TryGetValue(field.Name, out var propName)) + { + propName = field.Name; + if (attr != null) + propName = attr.propertyName; + } + + propName = char.ToUpper(propName[0]) + propName.Substring(1); var structFieldReference = new CodeFieldReferenceExpression(new CodeMethodInvokeExpression( new CodeMethodReferenceExpression(new CodeSnippetExpression("BlockEngine"), "GetBlockInfo", new CodeTypeReference(type)), @@ -93,9 +125,18 @@ namespace CodeGenerator { new CodeAssignStatement(structFieldReference, new CodePropertySetValueReferenceExpression()) }, - Type = new CodeTypeReference(field.FieldType) + Type = new CodeTypeReference(field.FieldType), + Attributes = MemberAttributes.Public | MemberAttributes.Final, + Comments = + { + _start, new CodeCommentStatement($"Gets or sets the {baseClass}'s {propName} property." + + $" {(attr != null ? "Tweakable stat." : "May not be saved.")}", true), _end + } }); } } + + private static readonly CodeCommentStatement _start = new CodeCommentStatement("", true); + private static readonly CodeCommentStatement _end = new CodeCommentStatement("", true); } } \ No newline at end of file diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 15a7e1c..0af44ab 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -1,6 +1,8 @@ -using System.CodeDom; -using System.CodeDom.Compiler; -using System.IO; +using System.Collections.Generic; +using RobocraftX.Blocks; +using RobocraftX.PilotSeat; +using Techblox.EngineBlock; +using Techblox.WheelRigBlock; namespace CodeGenerator { @@ -9,8 +11,31 @@ namespace CodeGenerator public static void Main(string[] args) { var bcg = new BlockClassGenerator(); - bcg.Generate("TestBlock", "TEST_BLOCK"); - bcg.Generate("Engine", null); + bcg.Generate("Engine", null, new Dictionary + { + { "engineOn", "On" } + }, typeof(EngineBlockComponent), // Simulation time properties + typeof(EngineBlockTweakableComponent), typeof(EngineBlockReadonlyComponent)); + bcg.Generate("DampedSpring", "DAMPEDSPRING_BLOCK_GROUP", new Dictionary + { + {"maxExtent", "MaxExtension"} + }, + typeof(TweakableJointDampingComponent), typeof(DampedSpringReadOnlyStruct)); + bcg.Generate("LogicGate", "LOGIC_BLOCK_GROUP"); + bcg.Generate("Servo", types: typeof(ServoReadOnlyStruct), renames: new Dictionary + { + {"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 + { + {"pistonVelocity", "MaximumForce"} + }, typeof(PistonReadOnlyStruct)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/DampedSpring.cs b/TechbloxModdingAPI/Blocks/DampedSpring.cs index afff30b..9408f31 100644 --- a/TechbloxModdingAPI/Blocks/DampedSpring.cs +++ b/TechbloxModdingAPI/Blocks/DampedSpring.cs @@ -1,47 +1,71 @@ -using RobocraftX.Blocks; -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { - public class DampedSpring : Block + using RobocraftX.Common; + using Svelto.ECS; + + + public class DampedSpring : SignalingBlock { - public DampedSpring(EGID id) : base(id) + + /// + /// Constructs a(n) DampedSpring object representing an existing block. + /// + public DampedSpring(EGID egid) : + base(egid) { } - - public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) + + /// + /// Constructs a(n) DampedSpring object representing an existing block. + /// + public DampedSpring(uint id) : + base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) { } - + /// - /// The spring's stiffness. + /// Gets or sets the DampedSpring's Stiffness property. Tweakable stat. /// public float Stiffness { - get => BlockEngine.GetBlockInfo(this).stiffness; - - set => BlockEngine.GetBlockInfo(this).stiffness = value; + get + { + return BlockEngine.GetBlockInfo(this).stiffness; + } + set + { + BlockEngine.GetBlockInfo(this).stiffness = value; + } } - + /// - /// The spring's maximum damping force. + /// Gets or sets the DampedSpring's Damping property. Tweakable stat. /// public float Damping { - get => BlockEngine.GetBlockInfo(this).damping; - - set => BlockEngine.GetBlockInfo(this).damping = value; + get + { + return BlockEngine.GetBlockInfo(this).damping; + } + set + { + BlockEngine.GetBlockInfo(this).damping = value; + } } - + /// - /// The spring's maximum extension. + /// Gets or sets the DampedSpring's MaxExtension property. Tweakable stat. /// public float MaxExtension { - get => BlockEngine.GetBlockInfo(this).maxExtent; - - set => BlockEngine.GetBlockInfo(this).maxExtent = value; + get + { + return BlockEngine.GetBlockInfo(this).maxExtent; + } + set + { + BlockEngine.GetBlockInfo(this).maxExtent = value; + } } } -} \ No newline at end of file +} diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index 05c09e6..bb87ba8 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -1,35 +1,32 @@ -//------------------------------------------------------------------------------ -// -// Ezt a kódot eszköz generálta. -// Futásidejű verzió:4.0.30319.42000 -// -// Ennek a fájlnak a módosítása helytelen viselkedést eredményezhet, és elvész, ha -// a kódot újragenerálják. -// -//------------------------------------------------------------------------------ - namespace TechbloxModdingAPI.Blocks { using RobocraftX.Common; using Svelto.ECS; - public class Engine : Block + public class Engine : SignalingBlock { - /// Engine constructor - private Engine(EGID egid) : + /// + /// Constructs a(n) Engine object representing an existing block. + /// + public Engine(EGID egid) : base(egid) { } - /// Engine constructor - private Engine(uint id) : + /// + /// Constructs a(n) Engine object representing an existing block. + /// + public Engine(uint id) : base(new EGID(id, CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP)) { } - private bool EngineOn + /// + /// Gets or sets the Engine's On property. May not be saved. + /// + public bool On { get { @@ -41,7 +38,10 @@ namespace TechbloxModdingAPI.Blocks } } - private int CurrentGear + /// + /// Gets or sets the Engine's CurrentGear property. May not be saved. + /// + public int CurrentGear { get { @@ -53,7 +53,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float GearChangeCountdown + /// + /// Gets or sets the Engine's GearChangeCountdown property. May not be saved. + /// + public float GearChangeCountdown { get { @@ -65,7 +68,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentRpmAV + /// + /// Gets or sets the Engine's CurrentRpmAV property. May not be saved. + /// + public float CurrentRpmAV { get { @@ -77,7 +83,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentRpmLV + /// + /// Gets or sets the Engine's CurrentRpmLV property. May not be saved. + /// + public float CurrentRpmLV { get { @@ -89,7 +98,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TargetRpmAV + /// + /// Gets or sets the Engine's TargetRpmAV property. May not be saved. + /// + public float TargetRpmAV { get { @@ -101,7 +113,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TargetRpmLV + /// + /// Gets or sets the Engine's TargetRpmLV property. May not be saved. + /// + public float TargetRpmLV { get { @@ -113,7 +128,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float CurrentTorque + /// + /// Gets or sets the Engine's CurrentTorque property. May not be saved. + /// + public float CurrentTorque { get { @@ -125,7 +143,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TotalWheelVelocityAV + /// + /// Gets or sets the Engine's TotalWheelVelocityAV property. May not be saved. + /// + public float TotalWheelVelocityAV { get { @@ -137,7 +158,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float TotalWheelVelocityLV + /// + /// Gets or sets the Engine's TotalWheelVelocityLV property. May not be saved. + /// + public float TotalWheelVelocityLV { get { @@ -149,7 +173,10 @@ namespace TechbloxModdingAPI.Blocks } } - private int TotalWheelCount + /// + /// Gets or sets the Engine's TotalWheelCount property. May not be saved. + /// + public int TotalWheelCount { get { @@ -161,7 +188,10 @@ namespace TechbloxModdingAPI.Blocks } } - private bool LastGearUpInput + /// + /// Gets or sets the Engine's LastGearUpInput property. May not be saved. + /// + public bool LastGearUpInput { get { @@ -173,7 +203,10 @@ namespace TechbloxModdingAPI.Blocks } } - private bool LastGearDownInput + /// + /// Gets or sets the Engine's LastGearDownInput property. May not be saved. + /// + public bool LastGearDownInput { get { @@ -185,7 +218,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float ManualToAutoGearCoolOffCounter + /// + /// Gets or sets the Engine's ManualToAutoGearCoolOffCounter property. May not be saved. + /// + public float ManualToAutoGearCoolOffCounter { get { @@ -197,7 +233,10 @@ namespace TechbloxModdingAPI.Blocks } } - private float Load + /// + /// Gets or sets the Engine's Load property. May not be saved. + /// + public float Load { get { @@ -208,5 +247,155 @@ namespace TechbloxModdingAPI.Blocks BlockEngine.GetBlockInfo(this).load = value; } } + + /// + /// Gets or sets the Engine's Power property. Tweakable stat. + /// + public float Power + { + get + { + return BlockEngine.GetBlockInfo(this).power; + } + set + { + BlockEngine.GetBlockInfo(this).power = value; + } + } + + /// + /// Gets or sets the Engine's AutomaticGears property. Tweakable stat. + /// + public bool AutomaticGears + { + get + { + return BlockEngine.GetBlockInfo(this).automaticGears; + } + set + { + BlockEngine.GetBlockInfo(this).automaticGears = value; + } + } + + /// + /// Gets or sets the Engine's GearChangeTime property. May not be saved. + /// + public float GearChangeTime + { + get + { + return BlockEngine.GetBlockInfo(this).gearChangeTime; + } + set + { + BlockEngine.GetBlockInfo(this).gearChangeTime = value; + } + } + + /// + /// Gets or sets the Engine's MinRpm property. May not be saved. + /// + public float MinRpm + { + get + { + return BlockEngine.GetBlockInfo(this).minRpm; + } + set + { + BlockEngine.GetBlockInfo(this).minRpm = value; + } + } + + /// + /// Gets or sets the Engine's MaxRpm property. May not be saved. + /// + public float MaxRpm + { + get + { + return BlockEngine.GetBlockInfo(this).maxRpm; + } + set + { + BlockEngine.GetBlockInfo(this).maxRpm = value; + } + } + + /// + /// Gets or sets the Engine's GearDownRpms property. May not be saved. + /// + public Svelto.ECS.DataStructures.NativeDynamicArray GearDownRpms + { + get + { + return BlockEngine.GetBlockInfo(this).gearDownRpms; + } + set + { + BlockEngine.GetBlockInfo(this).gearDownRpms = value; + } + } + + /// + /// Gets or sets the Engine's GearUpRpm property. May not be saved. + /// + public float GearUpRpm + { + get + { + return BlockEngine.GetBlockInfo(this).gearUpRpm; + } + set + { + BlockEngine.GetBlockInfo(this).gearUpRpm = value; + } + } + + /// + /// Gets or sets the Engine's MaxRpmChange property. May not be saved. + /// + public float MaxRpmChange + { + get + { + return BlockEngine.GetBlockInfo(this).maxRpmChange; + } + set + { + BlockEngine.GetBlockInfo(this).maxRpmChange = value; + } + } + + /// + /// Gets or sets the Engine's ManualToAutoGearCoolOffTime property. May not be saved. + /// + public float ManualToAutoGearCoolOffTime + { + get + { + return BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime; + } + set + { + BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; + } + } + + /// + /// Gets or sets the Engine's EngineBlockDataId property. May not be saved. + /// + public int EngineBlockDataId + { + get + { + return BlockEngine.GetBlockInfo(this).engineBlockDataId; + } + set + { + BlockEngine.GetBlockInfo(this).engineBlockDataId = value; + } + } } } diff --git a/TechbloxModdingAPI/Blocks/LogicGate.cs b/TechbloxModdingAPI/Blocks/LogicGate.cs index 50a819c..05cc3bf 100644 --- a/TechbloxModdingAPI/Blocks/LogicGate.cs +++ b/TechbloxModdingAPI/Blocks/LogicGate.cs @@ -1,16 +1,26 @@ -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { + using RobocraftX.Common; + using Svelto.ECS; + + public class LogicGate : SignalingBlock { - public LogicGate(EGID id) : base(id) + + /// + /// Constructs a(n) LogicGate object representing an existing block. + /// + public LogicGate(EGID egid) : + base(egid) { } - - public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) + + /// + /// Constructs a(n) LogicGate object representing an existing block. + /// + public LogicGate(uint id) : + base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) { } } -} \ No newline at end of file +} diff --git a/TechbloxModdingAPI/Blocks/Piston.cs b/TechbloxModdingAPI/Blocks/Piston.cs index 22ee052..c351d59 100644 --- a/TechbloxModdingAPI/Blocks/Piston.cs +++ b/TechbloxModdingAPI/Blocks/Piston.cs @@ -1,49 +1,70 @@ -using System; - -using RobocraftX.Blocks; -using Svelto.ECS; -using Unity.Mathematics; - -using TechbloxModdingAPI.Utility; -using RobocraftX.Common; - namespace TechbloxModdingAPI.Blocks { - public class Piston : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Piston : SignalingBlock { - public Piston(EGID id) : base(id) + + /// + /// Constructs a(n) Piston object representing an existing block. + /// + public Piston(EGID egid) : + base(egid) { } - - public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) + + /// + /// Constructs a(n) Piston object representing an existing block. + /// + public Piston(uint id) : + base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) { } - - // custom piston properties - + /// - /// The piston's max extension distance. + /// Gets or sets the Piston's MaximumForce property. Tweakable stat. /// - public float MaximumExtension + public float MaximumForce { - get => BlockEngine.GetBlockInfo(this).maxDeviation; - - set - { - BlockEngine.GetBlockInfo(this).maxDeviation = value; - } - } - - /// - /// The piston's max extension force. + get + { + return BlockEngine.GetBlockInfo(this).pistonVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).pistonVelocity = value; + } + } + + /// + /// Gets or sets the Piston's MaxExtension property. Tweakable stat. /// - public float MaximumForce - { - get => BlockEngine.GetBlockInfo(this).pistonVelocity; - + public float MaxExtension + { + get + { + return BlockEngine.GetBlockInfo(this).maxDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } + } + + /// + /// Gets or sets the Piston's InputIsExtension property. Tweakable stat. + /// + public bool InputIsExtension + { + get + { + return BlockEngine.GetBlockInfo(this).hasProportionalInput; + } set { - BlockEngine.GetBlockInfo(this).pistonVelocity = value; + BlockEngine.GetBlockInfo(this).hasProportionalInput = value; } } } diff --git a/TechbloxModdingAPI/Blocks/Seat.cs b/TechbloxModdingAPI/Blocks/Seat.cs new file mode 100644 index 0000000..e06077f --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Seat.cs @@ -0,0 +1,56 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class Seat : SignalingBlock + { + + /// + /// Constructs a(n) Seat object representing an existing block. + /// + public Seat(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) Seat object representing an existing block. + /// + public Seat(uint id) : + base(new EGID(id, RobocraftX.PilotSeat.SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP)) + { + } + + /// + /// Gets or sets the Seat's FollowCam property. Tweakable stat. + /// + public bool FollowCam + { + get + { + return BlockEngine.GetBlockInfo(this).followCam; + } + set + { + BlockEngine.GetBlockInfo(this).followCam = value; + } + } + + /// + /// Gets or sets the Seat's CharacterColliderHeight property. May not be saved. + /// + public float CharacterColliderHeight + { + get + { + return BlockEngine.GetBlockInfo(this).characterColliderHeight; + } + set + { + BlockEngine.GetBlockInfo(this).characterColliderHeight = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Blocks/Servo.cs b/TechbloxModdingAPI/Blocks/Servo.cs index 613ab65..89bd194 100644 --- a/TechbloxModdingAPI/Blocks/Servo.cs +++ b/TechbloxModdingAPI/Blocks/Servo.cs @@ -1,71 +1,146 @@ -using RobocraftX.Blocks; -using RobocraftX.Common; -using Svelto.ECS; - namespace TechbloxModdingAPI.Blocks { - public class Servo : SignalingBlock + using RobocraftX.Common; + using Svelto.ECS; + + + public class Servo : SignalingBlock { - public Servo(EGID id) : base(id) + + /// + /// Constructs a(n) Servo object representing an existing block. + /// + public Servo(EGID egid) : + base(egid) { } - - public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) + + /// + /// Constructs a(n) Servo object representing an existing block. + /// + public Servo(uint id) : + base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the Servo's MaximumForce property. Tweakable stat. + /// + public float MaximumForce { + get + { + return BlockEngine.GetBlockInfo(this).servoVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).servoVelocity = value; + } } - - // custom servo properties - + /// - /// The servo's minimum angle. + /// Gets or sets the Servo's MinimumAngle property. Tweakable stat. /// public float MinimumAngle { - get => BlockEngine.GetBlockInfo(this).minDeviation; - - set - { - BlockEngine.GetBlockInfo(this).minDeviation = value; - } - } - - /// - /// The servo's maximum angle. + get + { + return BlockEngine.GetBlockInfo(this).minDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).minDeviation = value; + } + } + + /// + /// Gets or sets the Servo's MaximumAngle property. Tweakable stat. /// public float MaximumAngle { - get => BlockEngine.GetBlockInfo(this).maxDeviation; - - set - { - BlockEngine.GetBlockInfo(this).maxDeviation = value; - } + get + { + return BlockEngine.GetBlockInfo(this).maxDeviation; + } + set + { + BlockEngine.GetBlockInfo(this).maxDeviation = value; + } } - - /// - /// The servo's maximum force. + + /// + /// Gets or sets the Servo's Reverse property. Tweakable stat. /// - public float MaximumForce + public bool Reverse { - get => BlockEngine.GetBlockInfo(this).servoVelocity; - - set - { - BlockEngine.GetBlockInfo(this).servoVelocity = value; - } + get + { + return BlockEngine.GetBlockInfo(this).reverse; + } + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } } - - /// - /// The servo's direction. + + /// + /// Gets or sets the Servo's InputIsAngle property. Tweakable stat. /// - public bool Reverse + public bool InputIsAngle + { + get + { + return BlockEngine.GetBlockInfo(this).hasProportionalInput; + } + set + { + BlockEngine.GetBlockInfo(this).hasProportionalInput = value; + } + } + + /// + /// Gets or sets the Servo's DirectionVector property. May not be saved. + /// + public Unity.Mathematics.float3 DirectionVector + { + get + { + return BlockEngine.GetBlockInfo(this).directionVector; + } + set + { + BlockEngine.GetBlockInfo(this).directionVector = value; + } + } + + /// + /// Gets or sets the Servo's RotationAxis property. May not be saved. + /// + public Unity.Mathematics.float3 RotationAxis + { + get + { + return BlockEngine.GetBlockInfo(this).rotationAxis; + } + set + { + BlockEngine.GetBlockInfo(this).rotationAxis = value; + } + } + + /// + /// Gets or sets the Servo's ForceAxis property. May not be saved. + /// + public Unity.Mathematics.float3 ForceAxis { - get => BlockEngine.GetBlockInfo(this).reverse; - - set - { - BlockEngine.GetBlockInfo(this).reverse = value; - } + get + { + return BlockEngine.GetBlockInfo(this).forceAxis; + } + set + { + BlockEngine.GetBlockInfo(this).forceAxis = value; + } } } } diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs new file mode 100644 index 0000000..1eb4c0b --- /dev/null +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -0,0 +1,101 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class WheelRig : SignalingBlock + { + + /// + /// Constructs a(n) WheelRig object representing an existing block. + /// + public WheelRig(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) WheelRig object representing an existing block. + /// + public WheelRig(uint id) : + base(new EGID(id, CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP)) + { + } + + /// + /// Gets or sets the WheelRig's BrakingStrength property. Tweakable stat. + /// + public float BrakingStrength + { + get + { + return BlockEngine.GetBlockInfo(this).brakingStrength; + } + set + { + BlockEngine.GetBlockInfo(this).brakingStrength = value; + } + } + + /// + /// Gets or sets the WheelRig's MaxVelocity property. May not be saved. + /// + public float MaxVelocity + { + get + { + return BlockEngine.GetBlockInfo(this).maxVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).maxVelocity = value; + } + } + + /// + /// Gets or sets the WheelRig's SteerAngle property. Tweakable stat. + /// + public float SteerAngle + { + get + { + return BlockEngine.GetBlockInfo(this).steerAngle; + } + set + { + BlockEngine.GetBlockInfo(this).steerAngle = value; + } + } + + /// + /// Gets or sets the WheelRig's VelocityForMinAngle property. May not be saved. + /// + public float VelocityForMinAngle + { + get + { + return BlockEngine.GetBlockInfo(this).velocityForMinAngle; + } + set + { + BlockEngine.GetBlockInfo(this).velocityForMinAngle = value; + } + } + + /// + /// Gets or sets the WheelRig's MinSteerAngleFactor property. May not be saved. + /// + public float MinSteerAngleFactor + { + get + { + return BlockEngine.GetBlockInfo(this).minSteerAngleFactor; + } + set + { + BlockEngine.GetBlockInfo(this).minSteerAngleFactor = value; + } + } + } +} diff --git a/TechbloxModdingAPI/Utility/OptionalRef.cs b/TechbloxModdingAPI/Utility/OptionalRef.cs index 2410f1b..79f7175 100644 --- a/TechbloxModdingAPI/Utility/OptionalRef.cs +++ b/TechbloxModdingAPI/Utility/OptionalRef.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.InteropServices; using Svelto.DataStructures; using Svelto.ECS; From 9693341d7ae370c84b2c58d9ad6121474403154e Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Aug 2021 00:34:39 +0200 Subject: [PATCH 4/5] Add block types, run tests, remove unintended properties --- TechbloxModdingAPI/Block.cs | 11 ++++++++++- TechbloxModdingAPI/Blocks/Engine.cs | 25 +++---------------------- TechbloxModdingAPI/Blocks/WheelRig.cs | 5 +++++ 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/TechbloxModdingAPI/Block.cs b/TechbloxModdingAPI/Block.cs index efea216..d4dead6 100644 --- a/TechbloxModdingAPI/Block.cs +++ b/TechbloxModdingAPI/Block.cs @@ -10,6 +10,7 @@ using RobocraftX.Blocks; using Unity.Mathematics; using Gamecraft.Blocks.GUI; using HarmonyLib; +using RobocraftX.PilotSeat; using TechbloxModdingAPI.Blocks; using TechbloxModdingAPI.Blocks.Engines; @@ -93,7 +94,13 @@ namespace TechbloxModdingAPI new Dictionary, Type)> { {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP, (id => new DampedSpring(id), typeof(DampedSpring))}, - {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))} + {CommonExclusiveGroups.ENGINE_BLOCK_BUILD_GROUP, (id => new Engine(id), typeof(Engine))}, + {CommonExclusiveGroups.LOGIC_BLOCK_GROUP, (id => new LogicGate(id), typeof(LogicGate))}, + {CommonExclusiveGroups.PISTON_BLOCK_GROUP, (id => new Piston(id), typeof(Piston))}, + {SeatGroups.PASSENGER_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, + {SeatGroups.PILOTSEAT_BLOCK_BUILD_GROUP, (id => new Seat(id), typeof(Seat))}, + {CommonExclusiveGroups.SERVO_BLOCK_GROUP, (id => new Servo(id), typeof(Servo))}, + {CommonExclusiveGroups.WHEELRIG_BLOCK_BUILD_GROUP, (id => new WheelRig(id), typeof(WheelRig))} }; internal static Block New(EGID egid) @@ -340,6 +347,8 @@ namespace TechbloxModdingAPI return; } blockGroup?.RemoveInternal(this); + if (!InitData.Valid) + return; BlockEngine.GetBlockInfo(this).currentBlockGroup = (int?) value?.Id.entityID ?? -1; value?.AddInternal(this); blockGroup = value; diff --git a/TechbloxModdingAPI/Blocks/Engine.cs b/TechbloxModdingAPI/Blocks/Engine.cs index bb87ba8..6140b11 100644 --- a/TechbloxModdingAPI/Blocks/Engine.cs +++ b/TechbloxModdingAPI/Blocks/Engine.cs @@ -324,17 +324,13 @@ namespace TechbloxModdingAPI.Blocks } /// - /// Gets or sets the Engine's GearDownRpms property. May not be saved. + /// Gets the Engine's GearDownRpms property. May not be saved. /// - public Svelto.ECS.DataStructures.NativeDynamicArray GearDownRpms + public float[] GearDownRpms { get { - return BlockEngine.GetBlockInfo(this).gearDownRpms; - } - set - { - BlockEngine.GetBlockInfo(this).gearDownRpms = value; + return BlockEngine.GetBlockInfo(this).gearDownRpms.ToManagedArray(); } } @@ -382,20 +378,5 @@ namespace TechbloxModdingAPI.Blocks BlockEngine.GetBlockInfo(this).manualToAutoGearCoolOffTime = value; } } - - /// - /// Gets or sets the Engine's EngineBlockDataId property. May not be saved. - /// - public int EngineBlockDataId - { - get - { - return BlockEngine.GetBlockInfo(this).engineBlockDataId; - } - set - { - BlockEngine.GetBlockInfo(this).engineBlockDataId = value; - } - } } } diff --git a/TechbloxModdingAPI/Blocks/WheelRig.cs b/TechbloxModdingAPI/Blocks/WheelRig.cs index 1eb4c0b..28ba739 100644 --- a/TechbloxModdingAPI/Blocks/WheelRig.cs +++ b/TechbloxModdingAPI/Blocks/WheelRig.cs @@ -1,3 +1,5 @@ +using TechbloxModdingAPI.Tests; + namespace TechbloxModdingAPI.Blocks { using RobocraftX.Common; @@ -56,6 +58,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's SteerAngle property. Tweakable stat. /// + [TestValue(0f)] // Can be 0 for no steer variant public float SteerAngle { get @@ -71,6 +74,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's VelocityForMinAngle property. May not be saved. /// + [TestValue(0f)] public float VelocityForMinAngle { get @@ -86,6 +90,7 @@ namespace TechbloxModdingAPI.Blocks /// /// Gets or sets the WheelRig's MinSteerAngleFactor property. May not be saved. /// + [TestValue(0f)] public float MinSteerAngleFactor { get From 77d5e59ef6012660c26db5c6b161488554851b00 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 12 Aug 2021 00:44:23 +0200 Subject: [PATCH 5/5] Add Motor class --- CodeGenerator/Program.cs | 1 + TechbloxModdingAPI/Blocks/Motor.cs | 71 ++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 TechbloxModdingAPI/Blocks/Motor.cs diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs index 0af44ab..0e9dea5 100644 --- a/CodeGenerator/Program.cs +++ b/CodeGenerator/Program.cs @@ -36,6 +36,7 @@ namespace CodeGenerator { {"pistonVelocity", "MaximumForce"} }, typeof(PistonReadOnlyStruct)); + bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct)); } } } \ No newline at end of file diff --git a/TechbloxModdingAPI/Blocks/Motor.cs b/TechbloxModdingAPI/Blocks/Motor.cs new file mode 100644 index 0000000..233d5f6 --- /dev/null +++ b/TechbloxModdingAPI/Blocks/Motor.cs @@ -0,0 +1,71 @@ +namespace TechbloxModdingAPI.Blocks +{ + using RobocraftX.Common; + using Svelto.ECS; + + + public class Motor : SignalingBlock + { + + /// + /// Constructs a(n) Motor object representing an existing block. + /// + public Motor(EGID egid) : + base(egid) + { + } + + /// + /// Constructs a(n) Motor object representing an existing block. + /// + public Motor(uint id) : + base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP)) + { + } + + /// + /// Gets or sets the Motor's TopSpeed property. Tweakable stat. + /// + public float TopSpeed + { + get + { + return BlockEngine.GetBlockInfo(this).maxVelocity; + } + set + { + BlockEngine.GetBlockInfo(this).maxVelocity = value; + } + } + + /// + /// Gets or sets the Motor's Torque property. Tweakable stat. + /// + public float Torque + { + get + { + return BlockEngine.GetBlockInfo(this).maxForce; + } + set + { + BlockEngine.GetBlockInfo(this).maxForce = value; + } + } + + /// + /// Gets or sets the Motor's Reverse property. Tweakable stat. + /// + public bool Reverse + { + get + { + return BlockEngine.GetBlockInfo(this).reverse; + } + set + { + BlockEngine.GetBlockInfo(this).reverse = value; + } + } + } +}