diff --git a/Automation/gen_csproj.py b/Automation/gen_csproj.py
index 1180d71..9d5dfbc 100755
--- a/Automation/gen_csproj.py
+++ b/Automation/gen_csproj.py
@@ -3,15 +3,22 @@
import argparse
from pathlib import Path, PurePath
import re
+import os
DLL_EXCLUSIONS_REGEX = r"(System|Microsoft|Mono|IronPython|DiscordRPC)\."
def getAssemblyReferences(path):
asmDir = Path(path)
result = list()
+ addedPath = ""
+ if not asmDir.exists():
+ addedPath = "../"
+ asmDir = Path(addedPath + path)
for child in asmDir.iterdir():
if child.is_file() and re.search(DLL_EXCLUSIONS_REGEX, str(child), re.I) is None and str(child).lower().endswith(".dll"):
- result.append(str(child).replace("\\", "/"))
+ childstr = str(child)
+ childstr = os.path.relpath(childstr, addedPath).replace("\\", "/")
+ result.append(childstr)
return result
def buildReferencesXml(path):
@@ -27,16 +34,16 @@ def buildReferencesXml(path):
return "\n \n" + "".join(result) + " \n"
if __name__ == "__main__":
- parser = argparse.ArgumentParser(description="Generate GamecraftModdingAPI.csproj")
+ parser = argparse.ArgumentParser(description="Generate TechbloxModdingAPI.csproj")
# TODO (maybe?): add params for custom csproj read and write locations
args = parser.parse_args()
print("Building Assembly references")
- asmXml = buildReferencesXml("../ref/GamecraftPreview_Data/Managed")
+ asmXml = buildReferencesXml("../ref/TechbloxPreview_Data/Managed")
# print(asmXml)
- with open("../GamecraftModdingAPI/GamecraftModdingAPI.csproj", "r") as xmlFile:
- print("Parsing GamecraftModdingAPI.csproj")
+ with open("../TechbloxModdingAPI/TechbloxModdingAPI.csproj", "r") as xmlFile:
+ print("Parsing TechbloxModdingAPI.csproj")
fileStr = xmlFile.read()
# print(fileStr)
depsStart = re.search(r"\
+
+
diff --git a/CodeGenerator/Program.cs b/CodeGenerator/Program.cs
new file mode 100644
index 0000000..0e9dea5
--- /dev/null
+++ b/CodeGenerator/Program.cs
@@ -0,0 +1,42 @@
+using System.Collections.Generic;
+using RobocraftX.Blocks;
+using RobocraftX.PilotSeat;
+using Techblox.EngineBlock;
+using Techblox.WheelRigBlock;
+
+namespace CodeGenerator
+{
+ internal class Program
+ {
+ public static void Main(string[] args)
+ {
+ var bcg = new BlockClassGenerator();
+ 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));
+ bcg.Generate("Motor", null, null, typeof(MotorReadOnlyStruct));
+ }
+ }
+}
\ 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/GamecraftModdingAPI/App/AppEngine.cs b/GamecraftModdingAPI/App/AppEngine.cs
deleted file mode 100644
index 9cc454d..0000000
--- a/GamecraftModdingAPI/App/AppEngine.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-
-using RobocraftX.GUI.MyGamesScreen;
-using RobocraftX.GUI;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Engines;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.App
-{
- public class AppEngine : IFactoryEngine
- {
- public event EventHandler EnterMenu;
-
- public event EventHandler ExitMenu;
-
- public IEntityFactory Factory { set; private get; }
-
- public string Name => "GamecraftModdingAPIAppEngine";
-
- public bool isRemovable => false;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public void Dispose()
- {
- IsInMenu = false;
- ExceptionUtil.InvokeEvent(ExitMenu, this, new MenuEventArgs { });
- }
-
- public void Ready()
- {
- IsInMenu = true;
- ExceptionUtil.InvokeEvent(EnterMenu, this, new MenuEventArgs { });
- }
-
- // app functionality
-
- public bool IsInMenu
- {
- get;
- private set;
- } = false;
-
- public Game[] GetMyGames()
- {
- EntityCollection mgsevs = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames);
- var mgsevsB = mgsevs.ToBuffer().buffer;
- Game[] games = new Game[mgsevs.count];
- for (int i = 0; i < mgsevs.count; i++)
- {
- Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}");
- games[i] = new Game(mgsevsB[i].ID);
- }
- return games;
- }
- }
-
- public struct MenuEventArgs
- {
-
- }
-}
diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs
deleted file mode 100644
index 85fb672..0000000
--- a/GamecraftModdingAPI/App/GameGameEngine.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-using System;
-using System.Collections.Generic;
-using HarmonyLib;
-
-using RobocraftX;
-using RobocraftX.Common;
-using RobocraftX.Schedulers;
-using RobocraftX.SimulationModeState;
-using Svelto.ECS;
-using Svelto.Tasks;
-using Svelto.Tasks.Lean;
-
-using GamecraftModdingAPI.Blocks;
-using GamecraftModdingAPI.Engines;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.App
-{
- public class GameGameEngine : IApiEngine
- {
- public event EventHandler EnterGame;
-
- public event EventHandler ExitGame;
-
- public string Name => "GamecraftModdingAPIGameInfoMenuEngine";
-
- public bool isRemovable => false;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public void Dispose()
- {
- ExceptionUtil.InvokeEvent(ExitGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
- IsInGame = false;
- }
-
- public void Ready()
- {
- ExceptionUtil.InvokeEvent(EnterGame, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
- IsInGame = true;
- }
-
- // game functionality
-
- public bool IsInGame
- {
- get;
- private set;
- } = false;
-
- public void ExitCurrentGame(bool async = false)
- {
- if (async)
- {
- ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_TimeRunningAndStopped);
- }
- else
- {
- entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID).WantsToQuit = true;
- entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID);
- }
-
- }
-
- public IEnumerator ExitCurrentGameAsync()
- {
- /*
- while (Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING.isStopping) { yield return Yield.It; }
- AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToMenu").Invoke(FullGameFields.Instance, new object[0]);*/
- yield return Yield.It;
- entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID).WantsToQuit = true;
- entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID);
- }
-
- public void SaveCurrentGame()
- {
- ref GameSceneEntityStruct gses = ref entitiesDB.QueryEntity(CommonExclusiveGroups.GameSceneEGID);
- gses.LoadAfterSaving = false;
- gses.SaveNow = true;
- entitiesDB.PublishEntityChange(CommonExclusiveGroups.GameSceneEGID);
- }
-
- public bool IsTimeRunningMode()
- {
- return TimeRunningModeUtil.IsTimeRunningMode(entitiesDB);
- }
-
- public bool IsTimeStoppedMode()
- {
- return TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB);
- }
-
- public void ToggleTimeMode()
- {
- TimeRunningModeUtil.ToggleTimeRunningState(entitiesDB);
- }
-
- public EGID[] GetAllBlocksInGame(BlockIDs filter = BlockIDs.Invalid)
- {
- var allBlocks = entitiesDB.QueryEntities();
- List blockEGIDs = new List();
- if (filter == BlockIDs.Invalid)
- {
- foreach (var (blocks, _) in allBlocks)
- {
- var buffer = blocks.ToBuffer().buffer;
- for (int i = 0; i < buffer.capacity; i++)
- blockEGIDs.Add(buffer[i].ID);
- }
-
- return blockEGIDs.ToArray();
- }
- else
- {
- foreach (var (blocks, _) in allBlocks)
- {
- var array = blocks.ToBuffer().buffer;
- for (var index = 0; index < array.capacity; index++)
- {
- var block = array[index];
- if (block.DBID == (ulong) filter)
- blockEGIDs.Add(block.ID);
- }
- }
-
- return blockEGIDs.ToArray();
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs
deleted file mode 100644
index efcb73e..0000000
--- a/GamecraftModdingAPI/App/GameMenuEngine.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-using System;
-using HarmonyLib;
-
-using RobocraftX;
-using RobocraftX.Common;
-using RobocraftX.GUI;
-using RobocraftX.GUI.MyGamesScreen;
-using Svelto.ECS;
-using Svelto.ECS.Experimental;
-
-using GamecraftModdingAPI.Engines;
-using GamecraftModdingAPI.Utility;
-using Svelto.DataStructures;
-
-namespace GamecraftModdingAPI.App
-{
- public class GameMenuEngine : IFactoryEngine
- {
- public IEntityFactory Factory { set; private get; }
-
- public string Name => "GamecraftModdingAPIGameInfoGameEngine";
-
- public bool isRemovable => false;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public void Dispose()
- {
- IsInMenu = false;
- }
-
- public void Ready()
- {
- IsInMenu = true;
- }
-
- // game functionality
-
- public bool IsInMenu
- {
- get;
- private set;
- } = false;
-
- public bool CreateMyGame(EGID id, string path = "", uint thumbnailId = 0, string gameName = "", string creatorName = "", string description = "", long createdDate = 0L)
- {
- EntityComponentInitializer eci = Factory.BuildEntity(id);
- eci.Init(new MyGameDataEntityStruct
- {
- SavedGamePath = new ECSString(path),
- ThumbnailId = thumbnailId,
- GameName = new ECSString(gameName),
- CreatorName = new ECSString(creatorName),
- GameDescription = new ECSString(description),
- CreatedDate = createdDate,
- });
- // entitiesDB.PublishEntityChange(id); // this will always fail
- return true;
- }
-
- public uint HighestID()
- {
- EntityCollection games = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.MyGames);
- var gamesB = games.ToBuffer().buffer;
- uint max = 0;
- for (int i = 0; i < games.count; i++)
- {
- if (gamesB[i].ID.entityID > max)
- {
- max = gamesB[i].ID.entityID;
- }
- }
- return max;
- }
-
- public bool EnterGame(EGID id)
- {
- if (!ExistsGameInfo(id)) return false;
- ref MyGameDataEntityStruct mgdes = ref GetGameInfo(id);
- return EnterGame(mgdes.GameName, mgdes.SavedGamePath);
- }
-
- public bool EnterGame(string gameName, string path, ulong workshopId = 0uL, bool autoEnterSim = false)
- {
- GameMode.CurrentMode = autoEnterSim ? RCXMode.Play : RCXMode.Build;
- GameMode.SaveGameDetails = new SaveGameDetails(gameName, path, workshopId);
- // the private FullGameCompositionRoot.SwitchToGame() method gets passed to menu items for this reason
- AccessTools.Method(typeof(FullGameCompositionRoot), "SwitchToGame").Invoke(FullGameFields.Instance, new object[0]);
- return true;
- }
-
- public bool SetGameName(EGID id, string name)
- {
- if (!ExistsGameInfo(id)) return false;
- GetGameInfo(id).GameName.Set(name);
- GetGameViewInfo(id).MyGamesSlotComponent.GameName = StringUtil.SanitiseString(name);
- return true;
- }
-
- public bool SetGameDescription(EGID id, string name)
- {
- if (!ExistsGameInfo(id)) return false;
- GetGameInfo(id).GameDescription.Set(name);
- GetGameViewInfo(id).MyGamesSlotComponent.GameDescription = StringUtil.SanitiseString(name);
- return true;
- }
-
- public bool ExistsGameInfo(EGID id)
- {
- return entitiesDB.Exists(id);
- }
-
- public ref MyGameDataEntityStruct GetGameInfo(EGID id)
- {
- return ref GetComponent(id);
- }
-
- public ref MyGamesSlotEntityViewStruct GetGameViewInfo(EGID id)
- {
- EntityCollection entities =
- entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities);
- var entitiesB = entities.ToBuffer().buffer;
- for (int i = 0; i < entities.count; i++)
- {
- if (entitiesB[i].ID.entityID == id.entityID)
- {
- return ref entitiesB[i];
- }
- }
- MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1];
- return ref defRef[0];
- }
-
- public ref T GetComponent(EGID id) where T: unmanaged, IEntityComponent
- {
- return ref entitiesDB.QueryEntity(id);
- }
- }
-
- internal class MyGameDataEntityDescriptor_DamnItFJWhyDidYouMakeThisInternal : GenericEntityDescriptor { }
-}
diff --git a/GamecraftModdingAPI/App/StateSyncRegPatch.cs b/GamecraftModdingAPI/App/StateSyncRegPatch.cs
deleted file mode 100644
index 9c2ce68..0000000
--- a/GamecraftModdingAPI/App/StateSyncRegPatch.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Reflection;
-
-using RobocraftX.CR.MainGame;
-using RobocraftX.StateSync;
-
-using HarmonyLib;
-
-namespace GamecraftModdingAPI.App
-{
- [HarmonyPatch]
- class StateSyncRegPatch
- {
- public static void Postfix(StateSyncRegistrationHelper stateSyncReg)
- {
- // register sim/build events engines
- Game.InitDeterministic(stateSyncReg);
- }
-
- [HarmonyTargetMethod]
- public static MethodBase Target()
- {
- return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose").MakeGenericMethod(typeof(object));
- }
- }
-}
diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs
deleted file mode 100644
index 33a1623..0000000
--- a/GamecraftModdingAPI/Block.cs
+++ /dev/null
@@ -1,501 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection.Emit;
-
-using Gamecraft.Blocks.BlockGroups;
-using Svelto.ECS;
-using Svelto.ECS.EntityStructs;
-using RobocraftX.Common;
-using RobocraftX.Blocks;
-using Unity.Mathematics;
-using Gamecraft.Blocks.GUI;
-
-using GamecraftModdingAPI.Blocks;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI
-{
- ///
- /// A single (perhaps scaled) block. Properties may return default values if the block is removed and then setting them is ignored.
- /// For specific block type operations, use the specialised block classes in the GamecraftModdingAPI.Blocks namespace.
- ///
- public class Block : IEquatable, IEquatable
- {
- protected static readonly PlacementEngine PlacementEngine = new PlacementEngine();
- protected static readonly MovementEngine MovementEngine = new MovementEngine();
- protected static readonly RotationEngine RotationEngine = new RotationEngine();
- protected static readonly RemovalEngine RemovalEngine = new RemovalEngine();
- protected static readonly SignalEngine SignalEngine = new SignalEngine();
- protected static readonly BlockEventsEngine BlockEventsEngine = new BlockEventsEngine();
- protected static readonly ScalingEngine ScalingEngine = new ScalingEngine();
-
- protected internal static readonly BlockEngine BlockEngine = new BlockEngine();
-
- ///
- /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position.
- /// Place blocks next to each other to connect them.
- /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game.
- ///
- /// The block's type
- /// The block's color
- /// The block color's darkness (0-9) - 0 is default color
- /// The block's position - default block size is 0.2
- /// The block's rotation in degrees
- /// The block's uniform scale - default scale is 1 (with 0.2 width)
- /// The block's non-uniform scale - 0 means is used
- /// The player who placed the block
- /// The placed block or null if failed
- public static Block PlaceNew(BlockIDs block, float3 position,
- float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0,
- int uscale = 1, float3 scale = default, Player player = null)
- {
- return PlaceNew(block, position, rotation, color, darkness, uscale, scale, player);
- }
-
- ///
- /// Place a new block at the given position. If scaled, position means the center of the block. The default block size is 0.2 in terms of position.
- /// Place blocks next to each other to connect them.
- /// The placed block will be a complete block with a placement grid and collision which will be saved along with the game.
- ///
- /// The block's type
- /// The block's color
- /// The block color's darkness (0-9) - 0 is default color
- /// The block's position - default block size is 0.2
- /// The block's rotation in degrees
- /// The block's uniform scale - default scale is 1 (with 0.2 width)
- /// The block's non-uniform scale - 0 means is used
- /// The player who placed the block
- /// The placed block or null if failed
- public static T PlaceNew(BlockIDs block, float3 position,
- float3 rotation = default, BlockColors color = BlockColors.Default, byte darkness = 0,
- int uscale = 1, float3 scale = default, Player player = null) where T : Block
- {
- if (PlacementEngine.IsInGame && GameState.IsBuildMode())
- {
- var egid = PlacementEngine.PlaceBlock(block, color, darkness,
- position, uscale, scale, player, rotation, out var initializer);
- var bl = New(egid.entityID, egid.groupID);
- bl.InitData.Group = BlockEngine.InitGroup(initializer);
- Placed += bl.OnPlacedInit;
- return bl;
- }
-
- return null;
- }
-
- ///
- /// Returns the most recently placed block.
- ///
- /// The block object
- public static Block GetLastPlacedBlock()
- {
- return New(BlockIdentifiers.LatestBlockID);
- }
-
- ///
- /// An event that fires each time a block is placed.
- ///
- public static event EventHandler Placed
- {
- add => BlockEventsEngine.Placed += value;
- remove => BlockEventsEngine.Placed -= value;
- }
-
- ///
- /// An event that fires each time a block is removed.
- ///
- public static event EventHandler Removed
- {
- add => BlockEventsEngine.Removed += value;
- remove => BlockEventsEngine.Removed -= value;
- }
-
- private static Dictionary> initializers = new Dictionary>();
-
- private static Dictionary typeToGroup =
- new Dictionary
- {
- {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.CONSOLE_BLOCK_GROUP}},
- {typeof(LogicGate), new [] {CommonExclusiveGroups.LOGIC_BLOCK_GROUP}},
- {typeof(Motor), new[] {CommonExclusiveGroups.MOTOR_BLOCK_GROUP}},
- {typeof(MusicBlock), new[] {CommonExclusiveGroups.MUSIC_BLOCK_GROUP}},
- {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.OBJID_BLOCK_GROUP}},
- {typeof(Piston), new[] {CommonExclusiveGroups.PISTON_BLOCK_GROUP}},
- {typeof(Servo), new[] {CommonExclusiveGroups.SERVO_BLOCK_GROUP}},
- {
- typeof(SpawnPoint),
- new[]
- {
- CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP,
- CommonExclusiveGroups.BUILDINGSPAWN_BLOCK_GROUP
- }
- },
- {
- typeof(SfxBlock),
- new[]
- {
- CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP,
- CommonExclusiveGroups.LOOPEDSFX_BLOCK_GROUP
- }
- },
- {typeof(DampedSpring), new [] {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP}},
- {typeof(TextBlock), new[] {CommonExclusiveGroups.TEXT_BLOCK_GROUP}},
- {typeof(Timer), new[] {CommonExclusiveGroups.TIMER_BLOCK_GROUP}}
- };
-
- ///
- /// Constructs a new instance of T with the given ID and group using dynamically created delegates.
- /// It's equivalent to new T(EGID) with a minimal overhead thanks to caching the created delegates.
- ///
- /// The block ID
- /// The block group
- /// The block's type or Block itself
- /// An instance of the provided type
- /// The block group doesn't match or cannot be found
- /// The block class doesn't have the needed constructor
- private static T New(uint id, ExclusiveGroupStruct? group = null) where T : Block
- {
- var type = typeof(T);
- EGID egid;
- if (!group.HasValue)
- {
- if (typeToGroup.TryGetValue(type, out var gr) && gr.Length == 1)
- egid = new EGID(id, gr[0]);
- else
- egid = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find block group!");
- }
- else
- {
- egid = new EGID(id, group.Value);
- if (typeToGroup.TryGetValue(type, out var gr)
- && gr.All(egs => egs != group.Value)) //If this subclass has a specific group, then use that - so Block should still work
- throw new BlockTypeException($"Incompatible block type! Type {type.Name} belongs to group {gr.Select(g => g.ToString()).Aggregate((a, b) => a + ", " + b)} instead of {group.Value}");
- }
-
- if (initializers.TryGetValue(type, out var func))
- {
- var bl = (T) func(egid);
- return bl;
- }
-
- //https://stackoverflow.com/a/10593806/2703239
- var ctor = type.GetConstructor(new[] {typeof(EGID)});
- if (ctor == null)
- throw new MissingMethodException("There is no constructor with an EGID parameter for this object");
- DynamicMethod dynamic = new DynamicMethod(string.Empty,
- type,
- new[] {typeof(EGID)},
- type);
- ILGenerator il = dynamic.GetILGenerator();
-
- //il.DeclareLocal(type);
- il.Emit(OpCodes.Ldarg_0); //Load EGID and pass to constructor
- il.Emit(OpCodes.Newobj, ctor); //Call constructor
- //il.Emit(OpCodes.Stloc_0); - doesn't seem like we need these
- //il.Emit(OpCodes.Ldloc_0);
- il.Emit(OpCodes.Ret);
-
- func = (Func) dynamic.CreateDelegate(typeof(Func));
- initializers.Add(type, func);
- var block = (T) func(egid);
- return block;
- }
-
- public Block(EGID id)
- {
- Id = id;
- var type = GetType();
- if (typeToGroup.TryGetValue(type, out var groups))
- {
- if (groups.All(gr => gr != id.groupID))
- throw new BlockTypeException("The block has the wrong group! The type is " + GetType() +
- " while the group is " + id.groupID);
- }
- else if (type != typeof(Block))
- Logging.LogWarning($"Unknown block type! Add {type} to the dictionary.");
- }
-
- ///
- /// This overload searches for the correct group the block is in.
- /// It will throw an exception if the block doesn't exist.
- /// Use the EGID constructor where possible or subclasses of Block as those specify the group.
- ///
- public Block(uint id)
- {
- Id = BlockEngine.FindBlockEGID(id) ?? throw new BlockTypeException("Could not find the appropriate group for the block. The block probably doesn't exist or hasn't been submitted.");
- }
-
- public EGID Id { get; }
-
- internal BlockEngine.BlockInitData InitData;
-
- ///
- /// The block's current position or zero if the block no longer exists.
- /// A block is 0.2 wide by default in terms of position.
- ///
- public float3 Position
- {
- get => MovementEngine.GetPosition(Id, InitData);
- set
- {
- MovementEngine.MoveBlock(Id, InitData, value);
- if (blockGroup != null)
- blockGroup.PosAndRotCalculated = false;
- }
- }
-
- ///
- /// The block's current rotation in degrees or zero if the block doesn't exist.
- ///
- public float3 Rotation
- {
- get => RotationEngine.GetRotation(Id, InitData);
- set
- {
- RotationEngine.RotateBlock(Id, InitData, value);
- if (blockGroup != null)
- blockGroup.PosAndRotCalculated = false;
- }
- }
-
- ///
- /// The block's non-uniform scale or zero if the block's invalid. Independent of the uniform scaling.
- /// The default scale of 1 means 0.2 in terms of position.
- ///
- public float3 Scale
- {
- get => BlockEngine.GetBlockInfo(this, (ScalingEntityStruct st) => st.scale);
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ScalingEntityStruct st, float3 val) => st.scale = val, value);
- if (!Exists) return; //UpdateCollision needs the block to exist
- ScalingEngine.UpdateCollision(Id);
- }
- }
-
- ///
- /// The block's uniform scale or zero if the block's invalid. Also sets the non-uniform scale.
- /// The default scale of 1 means 0.2 in terms of position.
- ///
- public int UniformScale
- {
- get => BlockEngine.GetBlockInfo(this, (UniformBlockScaleEntityStruct st) => st.scaleFactor);
- set
- {
- BlockEngine.SetBlockInfo(this, (ref UniformBlockScaleEntityStruct st, int val) => st.scaleFactor = val,
- value);
- Scale = new float3(value, value, value);
- }
- }
-
- ///
- /// The block's type (ID). Returns BlockIDs.Invalid if the block doesn't exist anymore.
- ///
- public BlockIDs Type
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (DBEntityStruct st) => (BlockIDs) st.DBID, BlockIDs.Invalid);
- }
- }
-
- ///
- /// The block's color. Returns BlockColors.Default if the block no longer exists.
- ///
- public BlockColor Color
- {
- get
- {
- byte index = BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.indexInPalette,
- byte.MaxValue);
- return new BlockColor(index);
- }
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) =>
- {
- color.indexInPalette = (byte) (val.Color + val.Darkness * 10);
- //color.overridePaletteColour = false;
- //color.needsUpdate = true;
- color.hasNetworkChange = true;
- color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette);
- }, value);
- }
- }
-
- ///
- /// The block's exact color. Gets reset to the palette color (Color property) after reentering the game.
- ///
- public float4 CustomColor
- {
- get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.paletteColour);
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) =>
- {
- color.paletteColour = val;
- //color.overridePaletteColour = true;
- //color.needsUpdate = true;
- color.hasNetworkChange = true;
- }, value);
- }
- }
-
- ///
- /// The text displayed on the block if applicable, or null.
- /// Setting it is temporary to the session, it won't be saved.
- ///
- public string Label
- {
- get => BlockEngine.GetBlockInfoViewStruct(this, (TextLabelEntityViewStruct st) => st.textLabelComponent?.text);
- set
- {
- BlockEngine.SetBlockInfoViewStruct(this, (ref TextLabelEntityViewStruct text, string val) =>
- {
- if (text.textLabelComponent != null) text.textLabelComponent.text = val;
- }, value);
- }
- }
-
- private BlockGroup blockGroup;
- ///
- /// Returns the block group this block is a part of. Block groups can be placed using blueprints.
- /// Returns null if not part of a group.
- /// Setting the group after the block has been initialized will not update everything properly.
- /// You should only set this property on blocks newly placed by your code.
- ///
- public BlockGroup BlockGroup
- {
- get
- {
- if (blockGroup != null) return blockGroup;
- return blockGroup = BlockEngine.GetBlockInfo(this,
- (BlockGroupEntityComponent bgec) =>
- bgec.currentBlockGroup == -1 ? null : new BlockGroup(bgec.currentBlockGroup, this));
- }
- set
- {
- blockGroup?.RemoveInternal(this);
- BlockEngine.SetBlockInfo(this,
- (ref BlockGroupEntityComponent bgec, BlockGroup val) => bgec.currentBlockGroup = val?.Id ?? -1,
- value);
- value?.AddInternal(this);
- blockGroup = value;
- }
- }
-
- ///
- /// Whether the block exists. The other properties will return a default value if the block doesn't exist.
- /// If the block was just placed, then this will also return false but the properties will work correctly.
- ///
- public bool Exists => BlockEngine.BlockExists(Id);
-
- ///
- /// Returns an array of blocks that are connected to this one. Returns an empty array if the block doesn't exist.
- ///
- public Block[] GetConnectedCubes() => BlockEngine.GetConnectedBlocks(Id);
-
- ///
- /// Removes this block.
- ///
- /// True if the block exists and could be removed.
- public bool Remove() => RemovalEngine.RemoveBlock(Id);
-
- ///
- /// Returns the rigid body of the chunk of blocks this one belongs to during simulation.
- /// Can be used to apply forces or move the block around while the simulation is running.
- ///
- /// The SimBody of the chunk or null if the block doesn't exist or not in simulation mode.
- public SimBody GetSimBody()
- {
- return BlockEngine.GetBlockInfo(this,
- (GridConnectionsEntityStruct st) => st.machineRigidBodyId != uint.MaxValue
- ? new SimBody(st.machineRigidBodyId, st.clusterId)
- : null);
- }
-
- private void OnPlacedInit(object sender, BlockPlacedRemovedEventArgs e)
- { //Member method instead of lambda to avoid constantly creating delegates
- if (e.ID != Id) return;
- Placed -= OnPlacedInit; //And we can reference it
- InitData = default; //Remove initializer as it's no longer valid - if the block gets removed it shouldn't be used again
- }
-
- public override string ToString()
- {
- return $"{nameof(Id)}: {Id}, {nameof(Position)}: {Position}, {nameof(Type)}: {Type}, {nameof(Color)}: {Color}, {nameof(Exists)}: {Exists}";
- }
-
- public bool Equals(Block other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return Id.Equals(other.Id);
- }
-
- public bool Equals(EGID other)
- {
- return Id.Equals(other);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((Block) obj);
- }
-
- public override int GetHashCode()
- {
- return Id.GetHashCode();
- }
-
- public static void Init()
- {
- GameEngineManager.AddGameEngine(PlacementEngine);
- GameEngineManager.AddGameEngine(MovementEngine);
- GameEngineManager.AddGameEngine(RotationEngine);
- GameEngineManager.AddGameEngine(RemovalEngine);
- GameEngineManager.AddGameEngine(BlockEngine);
- GameEngineManager.AddGameEngine(BlockEventsEngine);
- GameEngineManager.AddGameEngine(ScalingEngine);
- GameEngineManager.AddGameEngine(SignalEngine);
- Wire.signalEngine = SignalEngine; // requires same functionality, no need to duplicate the engine
- }
-
- ///
- /// Convert the block to a specialised block class.
- ///
- /// The block.
- /// The specialised block type.
- public T Specialise() where T : Block
- {
- // What have I gotten myself into?
- // C# can't cast to a child of Block unless the object was originally that child type
- // And C# doesn't let me make implicit cast operators for child types
- // So thanks to Microsoft, we've got this horrible implementation using reflection
-
- //Lets improve that using delegates
- var block = New(Id.entityID, Id.groupID);
- if (this.InitData.Group != null)
- {
- block.InitData = this.InitData;
- Placed += block.OnPlacedInit; //Reset InitData of new object
- }
-
- return block;
- }
-
-#if DEBUG
- public static EntitiesDB entitiesDB
- {
- get
- {
- return BlockEngine.GetEntitiesDB();
- }
- }
-#endif
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/BlockColor.cs b/GamecraftModdingAPI/Blocks/BlockColor.cs
deleted file mode 100644
index bf22090..0000000
--- a/GamecraftModdingAPI/Blocks/BlockColor.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using Unity.Mathematics;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public struct BlockColor
- {
- public BlockColors Color;
- public byte Darkness;
-
- public byte Index => Color == BlockColors.Default
- ? byte.MaxValue
- : (byte) (Darkness * 10 + Color);
-
- public BlockColor(byte index)
- {
- if (index == byte.MaxValue)
- {
- Color = BlockColors.Default;
- Darkness = 0;
- }
- else
- {
- if (index > 99)
- throw new ArgumentOutOfRangeException(nameof(index), "Invalid color index. Must be 0-90 or 255.");
- Color = (BlockColors) (index % 10);
- Darkness = (byte) (index / 10);
- }
- }
-
- public BlockColor(BlockColors color, byte darkness)
- {
- if (darkness > 9)
- throw new ArgumentOutOfRangeException(nameof(darkness), "Darkness must be 0-9 where 0 is default.");
- Color = color;
- Darkness = darkness;
- }
-
- public float4 RGBA => Block.BlockEngine.ConvertBlockColor(Index);
-
- public override string ToString()
- {
- return $"{nameof(Color)}: {Color}, {nameof(Darkness)}: {Darkness}";
- }
- }
-
- ///
- /// Preset block colours
- ///
- public enum BlockColors
- {
- Default = byte.MaxValue,
- White = 0,
- Pink,
- Purple,
- Blue,
- Aqua,
- Green,
- Lime,
- Yellow,
- Orange,
- Red
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs
deleted file mode 100644
index 9ce6d62..0000000
--- a/GamecraftModdingAPI/Blocks/BlockEngine.cs
+++ /dev/null
@@ -1,294 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using Gamecraft.ColourPalette;
-using Gamecraft.TimeRunning;
-using Gamecraft.Wires;
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using RobocraftX.Physics;
-using RobocraftX.Scene.Simulation;
-using Svelto.DataStructures;
-using Svelto.ECS;
-using Svelto.ECS.Hybrid;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// Engine for executing general block actions
- ///
- public partial class BlockEngine : IApiEngine
- {
- public string Name { get; } = "GamecraftModdingAPIBlockGameEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public void Dispose()
- {
- }
-
- public void Ready()
- {
- }
-
- public Block[] GetConnectedBlocks(EGID blockID)
- {
- if (!BlockExists(blockID)) return new Block[0];
- Stack cubeStack = new Stack();
- FasterList cubes = new FasterList(10);
- var coll = entitiesDB.QueryEntities();
- foreach (var (ecoll, _) in coll)
- {
- var ecollB = ecoll.ToBuffer();
- for(int i = 0; i < ecoll.count; i++)
- {
- ref var conn = ref ecollB.buffer[i];
- conn.isProcessed = false;
- }
- }
-
- ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubes,
- (in GridConnectionsEntityStruct g) => { return false; });
-
- var ret = new Block[cubes.count];
- for (int i = 0; i < cubes.count; i++)
- ret[i] = new Block(cubes[i]);
- return ret;
- }
-
- public float4 ConvertBlockColor(byte index) => index == byte.MaxValue
- ? new float4(-1f, -1f, -1f, -1f)
- : entitiesDB.QueryEntity(index,
- CommonExclusiveGroups.COLOUR_PALETTE_GROUP).Colour;
-
- public ref T GetBlockInfo(EGID blockID) where T : unmanaged, IEntityComponent
- {
- if (entitiesDB.Exists(blockID))
- return ref entitiesDB.QueryEntity(blockID);
- T[] structHolder = new T[1]; //Create something that can be referenced
- return ref structHolder[0]; //Gets a default value automatically
- }
-
- public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent
- {
- if (entitiesDB.Exists(blockID))
- {
- // TODO: optimize by using EntitiesDB internal calls instead of iterating over everything
- BT> entities = entitiesDB.QueryEntities(blockID.groupID).ToBuffer();
- for (int i = 0; i < entities.count; i++)
- {
- if (entities.buffer[i].ID == blockID)
- {
- return ref entities.buffer[i];
- }
- }
- }
- T[] structHolder = new T[1]; //Create something that can be referenced
- return ref structHolder[0]; //Gets a default value automatically
- }
-
- public U GetBlockInfo(Block block, Func getter,
- U def = default) where T : unmanaged, IEntityComponent
- {
- if (entitiesDB.Exists(block.Id))
- return getter(entitiesDB.QueryEntity(block.Id));
- return GetBlockInitInfo(block, getter, def);
- }
-
- public U GetBlockInfoViewStruct(Block block, Func getter,
- U def = default) where T : struct, IEntityViewComponent
- {
- if (entitiesDB.Exists(block.Id))
- return getter(entitiesDB.QueryEntity(block.Id));
- return GetBlockInitInfo(block, getter, def);
- }
-
- private U GetBlockInitInfo(Block block, Func getter, U def) where T : struct, IEntityComponent
- {
- if (block.InitData.Group == null) return def;
- var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group);
- if (initializer.Has())
- return getter(initializer.Get());
- return def;
- }
-
- public delegate void Setter(ref T component, U value) where T : struct, IEntityComponent;
-
- public void SetBlockInfoViewStruct(Block block, Setter setter, U value) where T : struct, IEntityViewComponent
- {
- if (entitiesDB.Exists(block.Id))
- setter(ref entitiesDB.QueryEntity(block.Id), value);
- else
- SetBlockInitInfo(block, setter, value);
- }
-
- public void SetBlockInfo(Block block, Setter setter, U value) where T : unmanaged, IEntityComponent
- {
- if (entitiesDB.Exists(block.Id))
- setter(ref entitiesDB.QueryEntity(block.Id), value);
- else
- SetBlockInitInfo(block, setter, value);
- }
-
- private void SetBlockInitInfo(Block block, Setter setter, U value)
- where T : struct, IEntityComponent
- {
- if (block.InitData.Group != null)
- {
- var initializer = new EntityComponentInitializer(block.Id, block.InitData.Group);
- T component = initializer.Has() ? initializer.Get() : default;
- ref T structRef = ref component;
- setter(ref structRef, value);
- initializer.Init(structRef);
- }
- }
-
- public bool BlockExists(EGID blockID)
- {
- return entitiesDB.Exists(blockID);
- }
-
- public bool GetBlockInfoExists(Block block) where T : struct, IEntityComponent
- {
- if (entitiesDB.Exists(block.Id))
- return true;
- if (block.InitData.Group == null)
- return false;
- var init = new EntityComponentInitializer(block.Id, block.InitData.Group);
- return init.Has();
- }
-
- public SimBody[] GetSimBodiesFromID(byte id)
- {
- var ret = new FasterList(4);
- if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP))
- return new SimBody[0];
- var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer();
- var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP);
- for (int i = 0; i < oids.count; i++)
- {
- ref ObjectIdEntityStruct oid = ref oids.buffer[i];
- if (oid.objectId != id) continue;
- var rid = connections.Entity(oid.ID.entityID).machineRigidBodyId;
- foreach (var rb in ret)
- {
- if (rb.Id.entityID == rid)
- goto DUPLICATE; //Multiple Object Identifiers on one rigid body
- }
- ret.Add(new SimBody(rid));
- DUPLICATE: ;
- }
- return ret.ToArray();
- }
-
- public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim)
- {
- var ret = new FasterList(4);
- if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP))
- return new ObjectIdentifier[0];
- var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer();
- for (int i = 0; i < oids.count; i++)
- {
- ref ObjectIdEntityStruct oid = ref oids.buffer[i];
- if (sim ? oid.simObjectId == id : oid.objectId == id)
- ret.Add(new ObjectIdentifier(oid.ID));
- }
-
- return ret.ToArray();
- }
-
- public SimBody[] GetConnectedSimBodies(uint id)
- {
- var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP).ToBuffer();
- var list = new FasterList(4);
- for (int i = 0; i < joints.count; i++)
- {
- ref var joint = ref joints.buffer[i];
- if (joint.jointState == JointState.Broken) continue;
- if (joint.connectedEntityA == id) list.Add(new SimBody(joint.connectedEntityB));
- else if (joint.connectedEntityB == id) list.Add(new SimBody(joint.connectedEntityA));
- }
-
- return list.ToArray();
- }
-
- public SimBody[] GetClusterBodies(uint cid)
- {
- var groups = entitiesDB.QueryEntities();
- var bodies = new HashSet();
- foreach (var (coll, _) in groups)
- {
- var array = coll.ToBuffer().buffer;
- for (var index = 0; index < array.capacity; index++)
- {
- var conn = array[index];
- if (conn.clusterId == cid)
- bodies.Add(conn.machineRigidBodyId);
- }
- }
-
- return bodies.Select(id => new SimBody(id, cid)).ToArray();
- }
-
- public EGID? FindBlockEGID(uint id)
- {
- var groups = entitiesDB.FindGroups();
- foreach (ExclusiveGroupStruct group in groups)
- {
- if (entitiesDB.Exists(id, group))
- return new EGID(id, group);
- }
-
- return null;
- }
-
- public Cluster GetCluster(uint sbid)
- {
- var groups = entitiesDB.QueryEntities();
- foreach (var (coll, _) in groups)
- {
- var array = coll.ToBuffer().buffer;
- for (var index = 0; index < array.capacity; index++)
- {
- var conn = array[index];
- //Static blocks don't have a cluster ID but the cluster destruction manager should have one
- if (conn.machineRigidBodyId == sbid && conn.clusterId != uint.MaxValue)
- return new Cluster(conn.clusterId);
- }
- }
-
- return null;
- }
-
- public Block[] GetBodyBlocks(uint sbid)
- {
- var groups = entitiesDB.QueryEntities();
- var set = new HashSet();
- foreach (var (coll, _) in groups)
- {
- var array = coll.ToBuffer().buffer;
- for (var index = 0; index < array.capacity; index++)
- {
- var conn = array[index];
- if (conn.machineRigidBodyId == sbid)
- set.Add(new Block(conn.ID));
- }
- }
-
- return set.ToArray();
- }
-
-#if DEBUG
- public EntitiesDB GetEntitiesDB()
- {
- return entitiesDB;
- }
-#endif
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs
deleted file mode 100644
index 1bf6c15..0000000
--- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using System.Linq.Expressions;
-
-using Svelto.DataStructures;
-using Svelto.ECS;
-using Svelto.ECS.Internal;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public partial class BlockEngine
- {
- ///
- /// Holds information needed to construct a component initializer
- ///
- internal struct BlockInitData
- {
- public FasterDictionary Group;
- }
-
- internal delegate FasterDictionary GetInitGroup(
- EntityComponentInitializer initializer);
-
- ///
- /// Accesses the group field of the initializer
- ///
- internal GetInitGroup InitGroup = CreateAccessor("_group");
-
- //https://stackoverflow.com/questions/55878525/unit-testing-ref-structs-with-private-fields-via-reflection
- internal static TDelegate CreateAccessor(string memberName) where TDelegate : Delegate
- {
- var invokeMethod = typeof(TDelegate).GetMethod("Invoke");
- if (invokeMethod == null)
- throw new InvalidOperationException($"{typeof(TDelegate)} signature could not be determined.");
-
- var delegateParameters = invokeMethod.GetParameters();
- if (delegateParameters.Length != 1)
- throw new InvalidOperationException("Delegate must have a single parameter.");
-
- var paramType = delegateParameters[0].ParameterType;
-
- var objParam = Expression.Parameter(paramType, "obj");
- var memberExpr = Expression.PropertyOrField(objParam, memberName);
- Expression returnExpr = memberExpr;
- if (invokeMethod.ReturnType != memberExpr.Type)
- returnExpr = Expression.ConvertChecked(memberExpr, invokeMethod.ReturnType);
-
- var lambda =
- Expression.Lambda(returnExpr, $"Access{paramType.Name}_{memberName}", new[] {objParam});
- return lambda.Compile();
- }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs
deleted file mode 100644
index 1d55b29..0000000
--- a/GamecraftModdingAPI/Blocks/BlockIDs.cs
+++ /dev/null
@@ -1,356 +0,0 @@
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// Possible block types
- ///
- public enum BlockIDs : ushort
- {
- ///
- /// Called "nothing" in Gamecraft. (DBID.NOTHING)
- ///
- Invalid = ushort.MaxValue,
- AluminiumCube = 0,
- AxleS,
- HingeS = 3,
- MotorS,
- HingeM,
- MotorM,
- TyreM,
- AxleM,
- IronCube,
- RubberCube,
- OiledCube,
- AluminiumConeSegment, //12
- AluminiumCorner,
- AluminiumRoundedCorner,
- AluminiumSlicedCube,
- AluminiumRoundedSlicedCube,
- AluminiumCylinder,
- AluminiumPyramidSegment,
- AluminiumSlope,
- AluminiumRoundedSlope,
- AluminiumSphere,
- RubberConeSegment, //22
- RubberCorner,
- RubberRoundedCorner,
- RubberSlicedCube,
- RubberRoundedSlicedCube,
- RubberCylinder,
- RubberPyramidSegment,
- RubberSlope,
- RubberRoundedSlope,
- RubberSphere,
- OiledConeSegment, //32
- OiledCorner,
- OiledRoundedCorner,
- OiledSlicedCube,
- OiledRoundedSlicedCube,
- OiledCylinder,
- OiledPyramidSegment,
- OiledSlope,
- OiledRoundedSlope,
- OiledSphere,
- IronConeSegment, //42
- IronCorner,
- IronRoundedCorner,
- IronSlicedCube,
- IronRoundedSlicedCube,
- IronCylinder,
- IronPyramidSegment,
- IronSlope,
- IronRoundedSlope,
- IronSphere,
- GlassCube, //52
- GlassSlicedCube,
- GlassSlope,
- GlassCorner,
- GlassPyramidSegment,
- GlassRoundedSlicedCube,
- GlassRoundedSlope,
- GlassRoundedCorner,
- GlassConeSegment,
- GlassCylinder,
- GlassSphere,
- Lever, //63 - two IDs skipped
- PlayerSpawn = 66, //Crashes without special handling
- SmallSpawn,
- MediumSpawn,
- LargeSpawn,
- BallJoint,
- UniversalJoint,
- ServoAxle,
- ServoHinge,
- StepperAxle,
- StepperHinge,
- TelescopicJoint,
- DampedSpring,
- ServoPiston,
- StepperPiston,
- PneumaticPiston,
- PneumaticHinge,
- PneumaticAxle, //82
- PilotSeat = 90, //Might crash
- PassengerSeat,
- PilotControls,
- GrassCube,
- DirtCube,
- GrassConeSegment,
- GrassCorner,
- GrassRoundedCorner,
- GrassSlicedCube,
- GrassRoundedSlicedCube,
- GrassPyramidSegment,
- GrassSlope,
- GrassRoundedSlope,
- DirtConeSegment,
- DirtCorner,
- DirtRoundedCorner,
- DirtSlicedCube,
- DirtRoundedSlicedCube,
- DirtPyramidSegment,
- DirtSlope,
- DirtRoundedSlope,
- RubberHemisphere,
- AluminiumHemisphere,
- GrassInnerCornerBulged,
- DirtInnerCornerBulged,
- IronHemisphere,
- OiledHemisphere,
- GlassHemisphere,
- TyreS,
- ThreeWaySwitch,
- Dial, //120
- CharacterOnEnterTrigger, //Probably crashes
- CharacterOnLeaveTrigger,
- CharacterOnStayTrigger,
- ObjectOnEnterTrigger,
- ObjectOnLeaveTrigger,
- ObjectOnStayTrigger,
- Button,
- Switch,
- TextBlock, //Brings up a screen
- ConsoleBlock, //Brings up a screen
- Door,
- GlassDoor,
- PoweredDoor,
- PoweredGlassDoor,
- AluminiumTubeCorner,
- IronTubeCorner,
- WoodCube,
- WoodSlicedCube,
- WoodSlope,
- WoodCorner,
- WoodPyramidSegment,
- WoodConeSegment,
- WoodRoundedSlicedCube,
- WoodRoundedSlope,
- WoodRoundedCorner,
- WoodCylinder,
- WoodHemisphere,
- WoodSphere,
- BrickCube, //149
- BrickSlicedCube = 151,
- BrickSlope,
- BrickCorner,
- ConcreteCube,
- ConcreteSlicedCube,
- ConcreteSlope,
- ConcreteCorner,
- RoadCarTyre,
- OffRoadCarTyre,
- RacingCarTyre,
- BicycleTyre,
- FrontBikeTyre,
- RearBikeTyre,
- ChopperBikeTyre,
- TractorTyre,
- MonsterTruckTyre,
- MotocrossBikeTyre,
- CartTyre, //168
- ObjectIdentifier,
- ANDLogicBlock,
- NANDLogicBlock,
- NORLogicBlock,
- NOTLogicBlock,
- ORLogicBlock,
- XNORLogicBlock,
- XORLogicBlock,
- AbsoluteMathsBlock,
- AdderMathsBlock,
- DividerMathsBlock,
- SignMathsBlock, //180
- MaxMathsBlock,
- MinMathsBlock,
- MultiplierMathsBlock,
- SubtractorMathsBlock,
- SimpleConnector,
- MeanMathsBlock,
- Bit,
- Counter,
- Timer,
- ObjectFilter,
- PlayerFilter,
- TeamFilter,
- Number2Text, //193
- DestructionManager = 260,
- ChunkHealthModifier,
- ClusterHealthModifier, //262
- BeachTree1 = 200,
- BeachTree2,
- BeachTree3,
- Rock1,
- Rock2,
- Rock3,
- Rock4,
- BirchTree1,
- BirchTree2,
- BirchTree3,
- PineTree1,
- PineTree2,
- PineTree3,
- Flower1,
- Flower2,
- Flower3,
- Shrub1,
- Shrub2,
- Shrub3,
- CliffCube,
- CliffSlicedCorner,
- CliffCornerA,
- CliffCornerB,
- CliffSlopeA,
- CliffSlopeB,
- GrassEdge,
- GrassEdgeInnerCorner,
- GrassEdgeCorner,
- GrassEdgeSlope,
- CentreHUD,
- ObjectiveHUD,
- GameStatsHUD, //231
- GameOverBlock,
- SFXBlockGameplay = 240,
- SFXBlock8Bit,
- SFXBlockInstrument,
- SFXBlockSciFi,
- SFXBlockLoops,
- SFXBlockVocal,
- MovementConstrainer, //246
- RotationConstrainer,
- AdvancedMovementDampener,
- AdvancedRotationDampener,
- Mover = 250,
- Rotator,
- MovementDampener,
- RotationDampener,
- AdvancedMover,
- AdvancedRotator,
- MusicBlock, //256
- PlasmaCannonBlock,
- QuantumRiflePickup = 300,
- QuantumRifleAmmoPickup,
- AluminiumSlicedFraction,
- AluminiumSlicedSlope,
- AluminiumHalfPyramidLeft = 305,
- AluminiumHalfPyramidRight,
- AluminiumPyramidSliced,
- AluminiumTubeCross,
- AluminiumTubeT,
- AluminiumPlateSquare,
- AluminiumPlateCircle,
- AluminiumPlateTriangle, //312
- OiledSlicedFraction = 314,
- OiledSlicedSlope,
- OiledHalfPyramidLeft,
- OiledHalfPyramidRight,
- OiledPyramidSliced,
- GlassSlicedFraction,
- GlassSlicedSlope,
- GlassHalfPyramidLeft,
- GlassHalfPyramidRight,
- GlassPyramidSliced,
- RubberSlicedFraction,
- RubberSlicedSlope,
- RubberHalfPyramidLeft,
- RubberHalfPyramidRight,
- RubberPyramidSliced,
- WoodSlicedFraction,
- WoodSlicedSlope, //330
- WoodHalfPyramidLeft,
- WoodHalfPyramidRight,
- WoodPyramidSliced,
- HexNetSlicedFraction,
- HexNetSlicedSlope,
- HexNetHalfPyramidLeft,
- HexNetHalfPyramidRight,
- HexNetPyramidSliced,
- OiledTubeCross,
- OiledTubeT, //340
- GlassTubeCross,
- GlassTubeT,
- RubberTubeCross,
- RubberTubeT,
- WoodTubeCross,
- WoodTubeT,
- HexNetTubeCross,
- HexNetTubeT,
- BouncyCube,
- BouncySlicedCube, //350
- BouncySlope,
- BouncyCorner,
- OiledTubeCorner,
- GlassTubeCorner,
- RubberTubeCorner,
- WoodTubeCorner,
- Basketball,
- BowlingBall,
- SoccerBall,
- GolfBall, //360
- HockeyPuck,
- PoolBall,
- BouncyBall,
- TennisBall,
- UnlitCube,
- IronSlicedFraction,
- IronSlicedSlope,
- IronHalfPyramidLeft,
- IronHalfPyramidRight,
- IronPyramidSliced, //370
- IronTubeCross,
- IronTubeT,
- SFXBlockMob = 374,
- PointLight,
- SpotLight,
- SunLight,
- AmbientLight,
- UnlitGlowCube = 381,
- PointLightInvisible,
- SpotLightInvisible,
- UnlitSlope,
- UnlitGlowSlope,
- Fog,
- Sky,
- MagmaRockCube = 777,
- MagmaRockCubeSliced,
- MagmaRockSlope,
- MagmaRockCorner,
- MagmaRockPyramidSegment,
- MagmaRockConeSegment,
- MagmaRockSlicedRounded,
- MagmaRockSlopeRounded,
- MagmaRockCornerRounded,
- HexNetCube,
- HexNetCubeSliced,
- HexNetSlope,
- HexNetCorner,
- HexNetPyramidSegment,
- HexNetConeSegment,
- HexNetSlicedRounded,
- HexNetSlopeRounded,
- HexNetCornerRounded, //794
- MagmaRockBulgedInner,
- HexNetCylinder = 797,
- HexNetHemisphere,
- HexNetSphere,
- HexNetTubeCorner //800
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs b/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs
deleted file mode 100644
index 0c3222b..0000000
--- a/GamecraftModdingAPI/Blocks/BlockIdentifiers.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using Svelto.ECS;
-using RobocraftX.Common;
-
-using HarmonyLib;
-
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// ExclusiveGroups and IDs used with blocks
- ///
- public static class BlockIdentifiers
- {
- ///
- /// Blocks placed by the player
- /// - TODO
- //public static ExclusiveGroup OWNED_BLOCKS { get { return CommonExclusiveGroups.REAL_BLOCKS_GROUPS_DON_T_USE_IN_NEW_CODE; } }
-
- ///
- /// Extra parts used in functional blocks
- ///
- public static ExclusiveGroup FUNCTIONAL_BLOCK_PARTS { get { return CommonExclusiveGroups.FUNCTIONAL_BLOCK_PART_GROUP; } }
-
- ///
- /// Blocks which are disabled in Simulation mode
- ///
- public static ExclusiveGroup SIM_BLOCKS_DISABLED { get { return CommonExclusiveGroups.DISABLED_JOINTS_IN_SIM_GROUP; } }
-
- //public static ExclusiveGroup SPAWN_POINTS { get { return CommonExclusiveGroups.SPAWN_POINTS_GROUP; } }
-
- //public static ExclusiveGroup SPAWN_POINTS_DISABLED { get { return CommonExclusiveGroups.SPAWN_POINTS_DISABLED_GROUP; } }
-
- ///
- /// The ID of the most recently placed block
- ///
- public static uint LatestBlockID {
- get
- { //Need the private field as the property increments itself
- return ((uint) AccessTools.Field(typeof(CommonExclusiveGroups), "_nextBlockEntityID").GetValue(null)) - 1;
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/BlockTests.cs b/GamecraftModdingAPI/Blocks/BlockTests.cs
deleted file mode 100644
index 5447f6c..0000000
--- a/GamecraftModdingAPI/Blocks/BlockTests.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using System;
-
-using Gamecraft.Wires;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Tests;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
-#if TEST
- ///
- /// Block test cases. Not accessible in release versions.
- ///
- [APITestClass]
- public static class BlockTests
- {
- [APITestCase(TestType.EditMode)]
- public static void TestPlaceNew()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero);
- Assert.NotNull(newBlock.Id, "Newly placed block is missing Id. This should be populated when the block is placed.", "Newly placed block Id is not null, block successfully placed.");
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestInitProperty()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.AluminiumCube, Unity.Mathematics.float3.zero + 2);
- if (!Assert.CloseTo(newBlock.Position, (Unity.Mathematics.float3.zero + 2), $"Newly placed block at {newBlock.Position} is expected at {Unity.Mathematics.float3.zero + 2}.", "Newly placed block position matches.")) return;
- //Assert.Equal(newBlock.Exists, true, "Newly placed block does not exist, possibly because Sync() skipped/missed/failed.", "Newly placed block exists, Sync() successful.");
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestTextBlock()
- {
- TextBlock textBlock = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { textBlock = Block.PlaceNew(BlockIDs.TextBlock, Unity.Mathematics.float3.zero + 1); }, "Block.PlaceNew() raised an exception: ", "Block.PlaceNew() completed without issue.");
- if (!Assert.NotNull(textBlock, "Block.PlaceNew() returned null, possibly because it failed silently.", "Specialized TextBlock is not null.")) return;
- if (!Assert.NotNull(textBlock.Text, "TextBlock.Text is null, possibly because it failed silently.", "TextBlock.Text is not null.")) return;
- if (!Assert.NotNull(textBlock.TextBlockId, "TextBlock.TextBlockId is null, possibly because it failed silently.", "TextBlock.TextBlockId is not null.")) return;
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestMotor()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.MotorS, Unity.Mathematics.float3.zero + 1);
- Motor b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue.");
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Motor is not null.")) return;
- if (!Assert.CloseTo(b.Torque, 75f, $"Motor.Torque {b.Torque} does not equal default value, possibly because it failed silently.", "Motor.Torque close enough to default.")) return;
- if (!Assert.CloseTo(b.TopSpeed, 30f, $"Motor.TopSpeed {b.TopSpeed} does not equal default value, possibly because it failed silently.", "Motor.Torque is close enough to default.")) return;
- if (!Assert.Equal(b.Reverse, false, $"Motor.Reverse {b.Reverse} does not equal default value, possibly because it failed silently.", "Motor.Reverse is default.")) return;
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestPiston()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.PneumaticPiston, Unity.Mathematics.float3.zero + 1);
- Piston b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue.");
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Piston is not null.")) return;
- if (!Assert.CloseTo(b.MaximumExtension, 1.01f, $"Piston.MaximumExtension {b.MaximumExtension} does not equal default value, possibly because it failed silently.", "Piston.MaximumExtension is close enough to default.")) return;
- if (!Assert.CloseTo(b.MaximumForce, 750f, $"Piston.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Piston.MaximumForce is close enough to default.")) return;
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestServo()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.ServoAxle, Unity.Mathematics.float3.zero + 1);
- Servo b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue.");
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized Servo is not null.")) return;
- if (!Assert.CloseTo(b.MaximumAngle, 180f, $"Servo.MaximumAngle {b.MaximumAngle} does not equal default value, possibly because it failed silently.", "Servo.MaximumAngle is close enough to default.")) return;
- if (!Assert.CloseTo(b.MinimumAngle, -180f, $"Servo.MinimumAngle {b.MinimumAngle} does not equal default value, possibly because it failed silently.", "Servo.MinimumAngle is close enough to default.")) return;
- if (!Assert.CloseTo(b.MaximumForce, 750f, $"Servo.MaximumForce {b.MaximumForce} does not equal default value, possibly because it failed silently.", "Servo.MaximumForce is close enough to default.")) return;
- }
-
- [APITestCase(TestType.Game)]
- public static void TestMusicBlock1()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.MusicBlock, Unity.Mathematics.float3.zero + 2);
- MusicBlock b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue.");
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return;
- if (!Assert.CloseTo(b.Volume, 100f, $"MusicBlock.Volume {b.Volume} does not equal default value, possibly because it failed silently.", "MusicBlock.Volume is close enough to default.")) return;
- if (!Assert.Equal(b.TrackIndex, 0, $"MusicBlock.TrackIndex {b.TrackIndex} does not equal default value, possibly because it failed silently.", "MusicBlock.TrackIndex is equal to default.")) return;
- _musicBlock = b;
- }
-
- private static MusicBlock _musicBlock;
-
- [APITestCase(TestType.EditMode)]
- public static void TestMusicBlock2()
- {
- //Block newBlock = Block.GetLastPlacedBlock();
- var b = _musicBlock;
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized MusicBlock is not null.")) return;
- b.IsPlaying = true; // play sfx
- if (!Assert.Equal(b.IsPlaying, true, $"MusicBlock.IsPlaying {b.IsPlaying} does not equal true, possibly because it failed silently.", "MusicBlock.IsPlaying is set properly.")) return;
- if (!Assert.Equal(b.ChannelType, ChannelType.None, $"MusicBlock.ChannelType {b.ChannelType} does not equal default value, possibly because it failed silently.", "MusicBlock.ChannelType is equal to default.")) return;
- //Assert.Log(b.Track.ToString());
- if (!Assert.Equal(b.Track.ToString(), new Guid("3237ff8f-f5f2-4f84-8144-496ca280f8c0").ToString(), $"MusicBlock.Track {b.Track} does not equal default value, possibly because it failed silently.", "MusicBlock.Track is equal to default.")) return;
- }
-
- [APITestCase(TestType.EditMode)]
- public static void TestLogicGate()
- {
- Block newBlock = Block.PlaceNew(BlockIDs.NOTLogicBlock, Unity.Mathematics.float3.zero + 1);
- LogicGate b = null; // Note: the assignment operation is a lambda, which slightly confuses the compiler
- Assert.Errorless(() => { b = newBlock.Specialise(); }, "Block.Specialize() raised an exception: ", "Block.Specialize() completed without issue.");
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized LogicGate is not null.")) return;
- if (!Assert.Equal(b.InputCount, 1u, $"LogicGate.InputCount {b.InputCount} does not equal default value, possibly because it failed silently.", "LogicGate.InputCount is default.")) return;
- if (!Assert.Equal(b.OutputCount, 1u, $"LogicGate.OutputCount {b.OutputCount} does not equal default value, possibly because it failed silently.", "LogicGate.OutputCount is default.")) return;
- if (!Assert.NotNull(b, "Block.Specialize() returned null, possibly because it failed silently.", "Specialized LogicGate is not null.")) return;
- //if (!Assert.Equal(b.PortName(0, true), "Input", $"LogicGate.PortName(0, input:true) {b.PortName(0, true)} does not equal default value, possibly because it failed silently.", "LogicGate.PortName(0, input:true) is close enough to default.")) return;
- LogicGate target = null;
- if (!Assert.Errorless(() => { target = Block.PlaceNew(BlockIDs.ANDLogicBlock, Unity.Mathematics.float3.zero + 2); })) return;
- Wire newWire = null;
- if (!Assert.Errorless(() => { newWire = b.Connect(0, target, 0);})) return;
- if (!Assert.NotNull(newWire, "SignalingBlock.Connect(...) returned null, possible because it failed silently.", "SignalingBlock.Connect(...) returned a non-null value.")) return;
- }
- }
-#endif
-}
diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs
deleted file mode 100644
index e696fca..0000000
--- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class ConsoleBlock : SignalingBlock
- {
- public ConsoleBlock(EGID id): base(id)
- {
- }
-
- public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.CONSOLE_BLOCK_GROUP))
- {
- }
-
- // custom console block properties
-
- ///
- /// Setting a nonexistent command will crash the game when switching to simulation
- ///
- public string Command
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.commandName);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.commandName.Set(val),
- value);
- }
- }
-
- public string Arg1
- {
- get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg1);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg1.Set(val),
- value);
- }
- }
-
- public string Arg2
- {
- get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg2);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg2.Set(val),
- value);
- }
- }
-
- public string Arg3
- {
- get => BlockEngine.GetBlockInfo(this, (ConsoleBlockEntityStruct st) => st.arg3);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ConsoleBlockEntityStruct st, string val) => st.arg3.Set(val),
- value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs
deleted file mode 100644
index 5a5a936..0000000
--- a/GamecraftModdingAPI/Blocks/DampedSpring.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class DampedSpring : Block
- {
- public DampedSpring(EGID id) : base(id)
- {
- }
-
- public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP))
- {
- }
-
- ///
- /// The spring's maximum force. This is known as Stiffness in-game
- ///
- public float MaxForce
- {
- get => BlockEngine.GetBlockInfo(this, (DampedSpringReadOnlyStruct dsrs) => dsrs.maxForce);
-
- set => BlockEngine.SetBlockInfo(this,
- (ref DampedSpringReadOnlyStruct dsrs, float val) => dsrs.maxForce = val, value);
- }
-
- ///
- /// Alias of MaxForce.
- ///
- public float Stiffness
- {
- get => MaxForce;
- set => MaxForce = value;
- }
-
- ///
- /// The spring's maximum damping force.
- ///
- public float Damping
- {
- get => BlockEngine.GetBlockInfo(this, (LinearJointForcesReadOnlyStruct ljf) => ljf.dampingForceMagnitude);
-
- set => BlockEngine.SetBlockInfo(this,
- (ref LinearJointForcesReadOnlyStruct ljf, float val) => ljf.dampingForceMagnitude = val, value);
- }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/GamecraftModdingAPI/Blocks/LogicGate.cs
deleted file mode 100644
index 2ec4cef..0000000
--- a/GamecraftModdingAPI/Blocks/LogicGate.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using RobocraftX.Common;
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.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/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs
deleted file mode 100644
index 0a69d27..0000000
--- a/GamecraftModdingAPI/Blocks/Motor.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class Motor : SignalingBlock
- {
- public Motor(EGID id) : base(id)
- {
- }
-
- public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP))
- {
- }
-
- // custom motor properties
-
- ///
- /// The motor's maximum rotational velocity.
- ///
- public float TopSpeed
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxVelocity);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxVelocity = val, value);
- }
- }
-
- ///
- /// The motor's maximum rotational force.
- ///
- public float Torque
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.maxForce);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, float val) => st.maxForce = val, value);
- }
- }
-
- ///
- /// The motor's direction.
- ///
- public bool Reverse
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MotorReadOnlyStruct st) => st.reverse);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref MotorReadOnlyStruct st, bool val) => st.reverse = val, value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/MovementEngine.cs b/GamecraftModdingAPI/Blocks/MovementEngine.cs
deleted file mode 100644
index a4ac0fa..0000000
--- a/GamecraftModdingAPI/Blocks/MovementEngine.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-using RobocraftX.Common;
-using RobocraftX.UECS;
-using Svelto.ECS;
-using Svelto.ECS.EntityStructs;
-using Unity.Transforms;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI.Utility;
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// Engine which executes block movement actions
- ///
- public class MovementEngine : IApiEngine
- {
- public string Name { get; } = "GamecraftModdingAPIMovementGameEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public bool IsInGame = false;
-
- public void Dispose()
- {
- IsInGame = false;
- }
-
- public void Ready()
- {
- IsInGame = true;
- }
-
- // implementations for Movement static class
-
- internal float3 MoveBlock(EGID blockID, BlockEngine.BlockInitData data, float3 vector)
- {
- if (!entitiesDB.Exists(blockID))
- {
- if (data.Group == null) return float3.zero;
- var init = new EntityComponentInitializer(blockID, data.Group);
- init.Init(new PositionEntityStruct {position = vector});
- init.Init(new GridRotationStruct {position = vector});
- init.Init(new LocalTransformEntityStruct {position = vector});
- return vector;
- }
- ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID);
- // main (persistent) position
- posStruct.position = vector;
- // placement grid position
- gridStruct.position = vector;
- // rendered position
- transStruct.position = vector;
- // collision position
- FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Translation
- {
- Value = posStruct.position
- });
- entitiesDB.QueryEntity(blockID).isProcessed = false;
- return posStruct.position;
- }
-
- internal float3 GetPosition(EGID blockID, BlockEngine.BlockInitData data)
- {
- if (!entitiesDB.Exists(blockID))
- {
- if (data.Group == null) return float3.zero;
- var init = new EntityComponentInitializer(blockID, data.Group);
- return init.Has() ? init.Get().position : float3.zero;
- }
- ref PositionEntityStruct posStruct = ref this.entitiesDB.QueryEntity(blockID);
- return posStruct.position;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs
deleted file mode 100644
index 6b99b6f..0000000
--- a/GamecraftModdingAPI/Blocks/MusicBlock.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-using System;
-
-using FMOD.Studio;
-using FMODUnity;
-using Gamecraft.Wires;
-using RobocraftX.Common;
-using RobocraftX.Blocks;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Tests;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class MusicBlock : SignalingBlock
- {
- public MusicBlock(EGID id) : base(id)
- {
- }
-
- public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.MUSIC_BLOCK_GROUP))
- {
- }
-
- public byte TrackIndex
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct st) => st.trackIndx);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref MusicBlockDataEntityStruct msdes, byte val) => msdes.trackIndx = val, value);
- }
- }
-
- public Guid Track
- {
- get
- {
- return BlockEngine.GetBlockInfo(this,
- (MusicBlockDataEntityStruct msdes) => msdes.fmod2DEventPaths.Get(msdes.trackIndx));
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, Guid val) =>
- {
- for (byte i = 0; i < msdes.fmod2DEventPaths.Count(); i++)
- {
- Guid track = msdes.fmod2DEventPaths.Get(i);
- if (track == val)
- {
- msdes.trackIndx = i;
- break;
- }
- }
- }, value);
- }
- }
-
- public Guid[] Tracks
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) =>
- {
- Guid[] tracks = new Guid[msdes.fmod2DEventPaths.Count()];
- for (byte i = 0; i < tracks.Length; i++)
- {
- tracks[i] = msdes.fmod2DEventPaths.Get(i);
- }
- return tracks;
- });
- }
- }
-
- public float Volume
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (MusicBlockDataEntityStruct msdes) => msdes.tweakableVolume);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref MusicBlockDataEntityStruct msdes, float val) => msdes.tweakableVolume = val, value);
- }
- }
-
- public ChannelType ChannelType
- {
- get
- {
- //Assert.Log("Block exists: " + Exists);
- return BlockEngine.GetBlockInfo(this,
- (MusicBlockDataEntityStruct msdes) => (ChannelType) msdes.channelType);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref MusicBlockDataEntityStruct msdes, ChannelType val) => msdes.channelType = (byte) val, value);
- }
- }
-
- public bool IsPlaying
- {
- get
- {
- return BlockEngine.GetBlockInfo(this,
- (MusicBlockDataEntityStruct msdes) => msdes.isPlaying);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref MusicBlockDataEntityStruct msdes, bool val) =>
- {
- if (msdes.isPlaying == val) return;
- if (val)
- {
- // start playing
- EventInstance inst = RuntimeManager.CreateInstance(msdes.fmod2DEventPaths.Get(msdes.trackIndx));
- inst.setVolume(msdes.tweakableVolume / 100f);
- inst.start();
- msdes.eventHandle = inst.handle;
- }
- else
- {
- // stop playing
- EventInstance inst = default(EventInstance);
- inst.handle = msdes.eventHandle;
- inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
- inst.release();
- }
- msdes.isPlaying = val;
- }, value);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs
deleted file mode 100644
index 1233343..0000000
--- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using Gamecraft.Wires;
-using RobocraftX.Common;
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class ObjectIdentifier : Block
- {
- public ObjectIdentifier(EGID id) : base(id)
- {
- }
-
- public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.OBJID_BLOCK_GROUP))
- {
- }
-
- public char Identifier
- {
- get => (char) BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.objectId + 'A');
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ObjectIdEntityStruct st, char val) =>
- {
- st.objectId = (byte) (val - 'A');
- Label = val + ""; //The label isn't updated automatically
- }, value);
- }
- }
-
- ///
- /// Simulation-time ID. Assigned by the game starting from 0.
- ///
- public byte SimID
- {
- get => BlockEngine.GetBlockInfo(this, (ObjectIdEntityStruct st) => st.simObjectId);
- }
-
- ///
- /// Finds the identifier blocks with the given ID.
- ///
- /// The ID to look for
- /// An array that may be empty
- public static ObjectIdentifier[] GetByID(char id) => BlockEngine.GetObjectIDsFromID((byte) (id - 'A'), false);
-
- ///
- /// Finds the identifier blocks with the given simulation-time ID. This ID is assigned by the game starting from 0.
- ///
- ///
- ///
- public static ObjectIdentifier[] GetBySimID(byte id) => BlockEngine.GetObjectIDsFromID(id, true);
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs
deleted file mode 100644
index 04b3aeb..0000000
--- a/GamecraftModdingAPI/Blocks/Piston.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI.Utility;
-using RobocraftX.Common;
-
-namespace GamecraftModdingAPI.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, (PistonReadOnlyStruct st) => st.maxDeviation);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxDeviation = val,
- value);
- }
- }
-
- ///
- /// The piston's max extension force.
- ///
- public float MaximumForce
- {
- get => BlockEngine.GetBlockInfo(this, (PistonReadOnlyStruct st) => st.maxForce);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref PistonReadOnlyStruct st, float val) => st.maxForce = val, value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs
deleted file mode 100644
index 5357e7f..0000000
--- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs
+++ /dev/null
@@ -1,131 +0,0 @@
-using System;
-using System.Reflection;
-
-using DataLoader;
-using HarmonyLib;
-using RobocraftX.Blocks;
-using RobocraftX.Blocks.Scaling;
-using RobocraftX.Character;
-using RobocraftX.Common;
-using RobocraftX.CR.MachineEditing;
-using Svelto.ECS;
-using Svelto.ECS.EntityStructs;
-using Unity.Mathematics;
-using UnityEngine;
-
-using GamecraftModdingAPI.Utility;
-using GamecraftModdingAPI.Engines;
-using GamecraftModdingAPI.Players;
-using RobocraftX.Rendering.GPUI;
-
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// Engine which executes block placement actions
- ///
- public class PlacementEngine : IApiEngine
- {
- public bool IsInGame;
-
- public void Dispose()
- {
- IsInGame = false;
- }
-
- public void Ready()
- {
- IsInGame = true;
- }
-
- public EntitiesDB entitiesDB { get; set; }
- private static BlockEntityFactory _blockEntityFactory; //Injected from PlaceBlockEngine
-
- public EGID PlaceBlock(BlockIDs block, BlockColors color, byte darkness, float3 position, int uscale,
- float3 scale, Player player, float3 rotation, out EntityComponentInitializer initializer)
- { //It appears that only the non-uniform scale has any visible effect, but if that's not given here it will be set to the uniform one
- if (darkness > 9)
- throw new Exception("That is too dark. Make sure to use 0-9 as darkness. (0 is default.)");
- initializer = BuildBlock((ushort) block, (byte) (color + darkness * 10), position, uscale, scale, rotation,
- (player ?? new Player(PlayerType.Local)).Id);
- return initializer.EGID;
- }
-
- private EntityComponentInitializer BuildBlock(ushort block, byte color, float3 position, int uscale, float3 scale, float3 rot, uint playerId)
- {
- if (_blockEntityFactory == null)
- throw new BlockException("The factory is null.");
- if (uscale < 1)
- throw new BlockException("Scale needs to be at least 1");
- if (scale.x < 4e-5) scale.x = uscale;
- if (scale.y < 4e-5) scale.y = uscale;
- if (scale.z < 4e-5) scale.z = uscale;
- uint dbid = block;
- if (!PrefabsID.HasPrefabRegistered(dbid, 0))
- throw new BlockException("Block with ID " + dbid + " not found!");
- //RobocraftX.CR.MachineEditing.PlaceBlockEngine
- ScalingEntityStruct scaling = new ScalingEntityStruct {scale = scale};
- Quaternion rotQ = Quaternion.Euler(rot);
- RotationEntityStruct rotation = new RotationEntityStruct {rotation = rotQ};
- GridRotationStruct gridRotation = new GridRotationStruct
- {position = position, rotation = rotQ};
- DBEntityStruct dbEntity = new DBEntityStruct {DBID = dbid};
- BlockPlacementScaleEntityStruct placementScale = new BlockPlacementScaleEntityStruct
- {
- blockPlacementHeight = uscale, blockPlacementWidth = uscale, desiredScaleFactor = uscale
- };
- EquippedColourStruct colour = new EquippedColourStruct {indexInPalette = color};
-
- EntityComponentInitializer
- structInitializer =
- _blockEntityFactory.Build(CommonExclusiveGroups.nextBlockEntityID, dbid); //The ghost block index is only used for triggers
- if (colour.indexInPalette != byte.MaxValue)
- structInitializer.Init(new ColourParameterEntityStruct
- {
- indexInPalette = colour.indexInPalette,
- hasNetworkChange = true
- });
- uint prefabId = PrefabsID.GetPrefabId(dbid, 0);
- structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId));
- structInitializer.Init(new PhysicsPrefabEntityStruct(prefabId));
- structInitializer.Init(dbEntity);
- structInitializer.Init(new PositionEntityStruct {position = position});
- structInitializer.Init(rotation);
- structInitializer.Init(scaling);
- structInitializer.Init(gridRotation);
- structInitializer.Init(new UniformBlockScaleEntityStruct
- {
- scaleFactor = placementScale.desiredScaleFactor
- });
- structInitializer.Init(new BlockPlacementInfoStruct()
- {
- loadedFromDisk = false,
- placedBy = playerId
- });
- PrimaryRotationUtility.InitialisePrimaryDirection(rotation.rotation, ref structInitializer);
- EGID playerEGID = new EGID(playerId, CharacterExclusiveGroups.OnFootGroup);
- ref PickedBlockExtraDataStruct pickedBlock = ref entitiesDB.QueryEntity(playerEGID);
- pickedBlock.placedBlockEntityID = structInitializer.EGID;
- pickedBlock.placedBlockWasAPickedBlock = false;
- return structInitializer;
- }
-
- public string Name { get; } = "GamecraftModdingAPIPlacementGameEngine";
-
- public bool isRemovable => false;
-
- [HarmonyPatch]
- public class FactoryObtainerPatch
- {
- static void Postfix(BlockEntityFactory blockEntityFactory)
- {
- _blockEntityFactory = blockEntityFactory;
- Logging.MetaDebugLog("Block entity factory injected.");
- }
-
- static MethodBase TargetMethod(Harmony instance)
- {
- return AccessTools.TypeByName("RobocraftX.CR.MachineEditing.PlaceBlockEngine").GetConstructors()[0];
- }
- }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/RotationEngine.cs b/GamecraftModdingAPI/Blocks/RotationEngine.cs
deleted file mode 100644
index ca97874..0000000
--- a/GamecraftModdingAPI/Blocks/RotationEngine.cs
+++ /dev/null
@@ -1,90 +0,0 @@
-using RobocraftX.Common;
-using RobocraftX.UECS;
-using Svelto.ECS;
-using Svelto.ECS.EntityStructs;
-using Unity.Mathematics;
-using UnityEngine;
-
-using GamecraftModdingAPI.Utility;
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Blocks
-{
- ///
- /// Engine which executes block movement actions
- ///
- public class RotationEngine : IApiEngine
- {
- public string Name { get; } = "GamecraftModdingAPIRotationGameEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public bool IsInGame = false;
-
- public void Dispose()
- {
- IsInGame = false;
- }
-
- public void Ready()
- {
- IsInGame = true;
- }
-
- // implementations for Rotation static class
-
- internal float3 RotateBlock(EGID blockID, BlockEngine.BlockInitData data, Vector3 vector)
- {
- if (!entitiesDB.Exists(blockID))
- {
- if (data.Group == null) return float3.zero;
- var init = new EntityComponentInitializer(blockID, data.Group);
- init.Init(new RotationEntityStruct {rotation = new Quaternion {eulerAngles = vector}});
- init.Init(new GridRotationStruct {rotation = new Quaternion {eulerAngles = vector}});
- init.Init(new LocalTransformEntityStruct {rotation = new Quaternion {eulerAngles = vector}});
- return vector;
- }
- ref RotationEntityStruct rotStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref GridRotationStruct gridStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref LocalTransformEntityStruct transStruct = ref this.entitiesDB.QueryEntity(blockID);
- ref UECSPhysicsEntityStruct phyStruct = ref this.entitiesDB.QueryEntity(blockID);
- // main (persistent) position
- Quaternion newRotation = rotStruct.rotation;
- newRotation.eulerAngles = vector;
- rotStruct.rotation = newRotation;
- // placement grid rotation
- Quaternion newGridRotation = gridStruct.rotation;
- newGridRotation.eulerAngles = vector;
- gridStruct.rotation = newGridRotation;
- // rendered position
- Quaternion newTransRotation = rotStruct.rotation;
- newTransRotation.eulerAngles = vector;
- transStruct.rotation = newTransRotation;
- // collision position
- FullGameFields._physicsWorld.EntityManager.SetComponentData(phyStruct.uecsEntity, new Unity.Transforms.Rotation
- {
- Value = rotStruct.rotation
- });
- entitiesDB.QueryEntity(blockID).isProcessed = false;
- return ((Quaternion)rotStruct.rotation).eulerAngles;
-
- }
-
- internal float3 GetRotation(EGID blockID, BlockEngine.BlockInitData data)
- {
- if (!entitiesDB.Exists(blockID))
- {
- if (data.Group == null) return float3.zero;
- var init = new EntityComponentInitializer(blockID, data.Group);
- return init.Has()
- ? (float3) ((Quaternion) init.Get().rotation).eulerAngles
- : float3.zero;
- }
-
- ref RotationEntityStruct rotStruct = ref entitiesDB.QueryEntity(blockID);
- return ((Quaternion) rotStruct.rotation).eulerAngles;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs
deleted file mode 100644
index 606a48a..0000000
--- a/GamecraftModdingAPI/Blocks/Servo.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.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, (ServoReadOnlyStruct st) => st.minDeviation);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.minDeviation = val, value);
- }
- }
-
- ///
- /// The servo's maximum angle.
- ///
- public float MaximumAngle
- {
- get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxDeviation);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxDeviation = val, value);
- }
- }
-
- ///
- /// The servo's maximum force.
- ///
- public float MaximumForce
- {
- get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.maxForce);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, float val) => st.maxForce = val, value);
- }
- }
-
- ///
- /// The servo's direction.
- ///
- public bool Reverse
- {
- get => BlockEngine.GetBlockInfo(this, (ServoReadOnlyStruct st) => st.reverse);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref ServoReadOnlyStruct st, bool val) => st.reverse = val, value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs
deleted file mode 100644
index 88d69d2..0000000
--- a/GamecraftModdingAPI/Blocks/SfxBlock.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-using System;
-using FMOD.Studio;
-using FMODUnity;
-using Gamecraft.Wires;
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class SfxBlock : SignalingBlock
- {
- public SfxBlock(EGID id) : base(id)
- {
- }
-
- public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */))
- {
- }
-
- public float Volume
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakableVolume);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakableVolume = val, value);
- }
- }
-
- public float Pitch
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.tweakablePitch);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, float val) => obj.tweakablePitch = val, value);
- }
- }
-
- public bool Is3D
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.is3D);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.is3D = val, value);
- }
- }
-
- public ChannelType ChannelType
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => (ChannelType)obj.channelType);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, ChannelType val) => obj.tweakableVolume = (byte) val, value);
- }
- }
-
- public byte TrackIndex
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.soundEffectIndex);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, byte val) => obj.soundEffectIndex = val, value);
- }
- }
-
- // track
- public Guid Track
- {
- get
- {
- return BlockEngine.GetBlockInfo(this,
- (SoundSfxBlockDataEntityStruct obj) => obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex));
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, Guid val) =>
- {
- for (byte i = 0; i < obj.fmod2DEventPaths.Count(); i++)
- {
- Guid track = obj.fmod2DEventPaths.Get(i);
- if (track == val)
- {
- obj.soundEffectIndex = i;
- obj.is3D = false;
- return;
- }
- }
- for (byte i = 0; i < obj.fmod3DEventPaths.Count(); i++)
- {
- Guid track = obj.fmod3DEventPaths.Get(i);
- if (track == val)
- {
- obj.soundEffectIndex = i;
- obj.is3D = true;
- return;
- }
- }
- }, value);
- }
- }
-
- // all tracks
- public Guid[] Tracks2D
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) =>
- {
- Guid[] tracks = new Guid[obj.fmod2DEventPaths.Count()];
- for (byte i = 0; i < tracks.Length; i++)
- {
- tracks[i] = obj.fmod2DEventPaths.Get(i);
- }
- return tracks;
- });
- }
- }
-
- public Guid[] Tracks3D
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) =>
- {
- Guid[] tracks = new Guid[obj.fmod3DEventPaths.Count()];
- for (byte i = 0; i < tracks.Length; i++)
- {
- tracks[i] = obj.fmod2DEventPaths.Get(i);
- }
- return tracks;
- });
- }
- }
-
- public bool IsLooped
- {
- get
- {
- return BlockEngine.GetBlockInfo(this, (SoundSfxBlockDataEntityStruct obj) => obj.isLoopedBlock);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this,
- (ref SoundSfxBlockDataEntityStruct obj, bool val) => obj.isLoopedBlock = val, value);
- }
- }
-
- public bool IsPlaying
- {
- get
- {
- return BlockEngine.GetBlockInfo(this,
- (SoundSfxBlockDataEntityStruct obj) => obj.isPlaying);
- }
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SoundSfxBlockDataEntityStruct obj, bool val) =>
- {
- if (obj.isPlaying == val) return;
- if (val)
- {
- // start playing
- EventInstance inst = RuntimeManager.CreateInstance(obj.is3D ? obj.fmod3DEventPaths.Get(obj.soundEffectIndex) : obj.fmod2DEventPaths.Get(obj.soundEffectIndex));
- inst.setVolume(obj.tweakableVolume / 100f);
- inst.start();
- obj.eventHandle = inst.handle;
- }
- else
- {
- // stop playing
- EventInstance inst = default(EventInstance);
- inst.handle = obj.eventHandle;
- inst.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
- inst.release();
- }
- obj.isPlaying = val;
- }, value);
- }
- }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs
deleted file mode 100644
index 17bffd9..0000000
--- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Gamecraft.CharacterVulnerability;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class SpawnPoint : Block
- {
- public SpawnPoint(EGID id) : base(id)
- {
- }
-
- public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP))
- {
- }
-
- // custom spawn point properties
-
- ///
- /// The lives the player spawns in with.
- ///
- public uint Lives
- {
- get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.lives);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, uint val) => st.lives = val, value);
- }
- }
-
- ///
- /// Whether the spawned player can take damage.
- ///
- public bool Damageable
- {
- get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.canTakeDamage);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.canTakeDamage = val, value);
- }
- }
-
- ///
- /// Whether the game over screen will be displayed
- ///
- public bool GameOverEnabled
- {
- get => BlockEngine.GetBlockInfo(this, (SpawnPointStatsEntityStruct st) => st.gameOverScreen);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SpawnPointStatsEntityStruct st, bool val) => st.gameOverScreen = val, value);
- }
- }
-
- ///
- /// The team id for players who spawn here.
- ///
- public byte Team
- {
- get => BlockEngine.GetBlockInfo(this, (SpawnPointIdsEntityStruct st) => st.teamId);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref SpawnPointIdsEntityStruct st, byte val) => st.teamId = val, value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs
deleted file mode 100644
index 6fa5487..0000000
--- a/GamecraftModdingAPI/Blocks/TextBlock.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-
-using Gamecraft.Blocks.GUI;
-using RobocraftX.Common;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class TextBlock : SignalingBlock
- {
- public TextBlock(EGID id) : base(id)
- {
- }
-
- public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.TEXT_BLOCK_GROUP))
- {
- }
-
- // custom text block properties
-
- ///
- /// The text block's current text.
- ///
- public string Text
- {
- get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textCurrent);
-
- set
- {
- if (value == null) value = "";
- BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) =>
- {
- if (val == null) val = "";
- tbds.textCurrent.Set(val);
- tbds.textStored.Set(val);
- }, value);
- BlockEngine.SetBlockInfo(this,
- (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockStringContent.Set(val), value);
- }
- }
-
- ///
- /// The text block's current text block ID (used in ChangeTextBlockCommand).
- ///
- public string TextBlockId
- {
- get => BlockEngine.GetBlockInfo(this, (TextBlockDataStruct st) => st.textBlockID);
-
- set
- {
- if (value == null) value = "";
- BlockEngine.SetBlockInfo(this, (ref TextBlockDataStruct tbds, string val) =>
- tbds.textBlockID.Set(val), value);
- BlockEngine.SetBlockInfo(this,
- (ref TextBlockNetworkDataStruct st, string val) => st.newTextBlockID.Set(val), value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs
deleted file mode 100644
index 0bbd302..0000000
--- a/GamecraftModdingAPI/Blocks/Timer.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System;
-
-using RobocraftX.Blocks;
-using RobocraftX.Common;
-using Gamecraft.Blocks.TimerBlock;
-using Svelto.ECS;
-using Unity.Mathematics;
-
-using GamecraftModdingAPI;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class Timer : SignalingBlock
- {
- public Timer(EGID id) : base(id)
- {
- }
-
- public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.TIMER_BLOCK_GROUP))
- {
- }
-
- // custom timer properties
-
- ///
- /// The player-specified start time.
- ///
- public float Start
- {
- get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.startTime);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.startTime = val,
- value);
- }
- }
-
- ///
- /// The player-specified end time.
- ///
- public float End
- {
- get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.endTime);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, float val) => tbds.endTime = val,
- value);
- }
- }
-
- ///
- /// Whether to display time with millisecond precision.
- ///
- public bool DisplayMilliseconds
- {
- get => BlockEngine.GetBlockInfo(this, (TimerBlockDataStruct st) => st.outputFormatHasMS);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref TimerBlockDataStruct tbds, bool val) => tbds.outputFormatHasMS = val,
- value);
- }
- }
-
- ///
- /// Current time (as of the last video frame), in milliseconds.
- ///
- public int CurrentTime
- {
- get => BlockEngine.GetBlockInfo(this, (TimerBlockLabelCacheEntityStruct st) => st.timeLastRenderFrameMS);
-
- set
- {
- BlockEngine.SetBlockInfo(this, (ref TimerBlockLabelCacheEntityStruct tbds, int val) => tbds.timeLastRenderFrameMS = val,
- value);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Blocks/Wire.cs b/GamecraftModdingAPI/Blocks/Wire.cs
deleted file mode 100644
index e58a625..0000000
--- a/GamecraftModdingAPI/Blocks/Wire.cs
+++ /dev/null
@@ -1,355 +0,0 @@
-using System;
-
-using Gamecraft.Wires;
-using Svelto.ECS;
-using Svelto.ECS.Experimental;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Blocks
-{
- public class Wire
- {
- internal static SignalEngine signalEngine;
-
- protected EGID startPortEGID;
-
- protected EGID endPortEGID;
-
- protected EGID startBlockEGID;
-
- protected EGID endBlockEGID;
-
- protected EGID wireEGID;
-
- protected bool inputToOutput;
-
- protected byte startPort;
-
- protected byte endPort;
-
- public static Wire Connect(SignalingBlock start, byte startPort, SignalingBlock end, byte endPort)
- {
- WireEntityStruct wire = signalEngine.CreateNewWire(start.Id, startPort, end.Id, endPort);
- return new Wire(wire, start, end);
- }
-
- ///
- /// An existing wire connection ending at the specified input.
- /// If multiple exist, this will return the first one found.
- ///
- /// Destination block.
- /// Port number.
- /// The wire, where the end of the wire is the block port specified, or null if does not exist.
- public static Wire ConnectedToInputPort(SignalingBlock end, byte endPort)
- {
- EGID port = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists);
- if (!exists) return null;
- WireEntityStruct wire = signalEngine.MatchPortToWire(port, end.Id, out exists);
- if (exists)
- {
- return new Wire(new Block(wire.sourceBlockEGID), end, wire.sourcePortUsage, endPort);
- }
- return null;
- }
-
- ///
- /// An existing wire connection starting at the specified output.
- /// If multiple exist, this will return the first one found.
- ///
- /// Source block entity ID.
- /// Port number.
- /// The wire, where the start of the wire is the block port specified, or null if does not exist.
- public static Wire ConnectedToOutputPort(SignalingBlock start, byte startPort)
- {
- EGID port = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists);
- if (!exists) return null;
- WireEntityStruct wire = signalEngine.MatchPortToWire(port, start.Id, out exists);
- if (exists)
- {
- return new Wire(start, new Block(wire.destinationBlockEGID), startPort, wire.destinationPortUsage);
- }
- return null;
- }
-
- ///
- /// Construct a wire object from an existing connection.
- ///
- /// Starting block ID.
- /// Ending block ID.
- /// Starting port number, or guess if omitted.
- /// Ending port number, or guess if omitted.
- /// Guessing failed or wire does not exist.
- public Wire(Block start, Block end, byte startPort = Byte.MaxValue, byte endPort = Byte.MaxValue)
- {
- startBlockEGID = start.Id;
- endBlockEGID = end.Id;
- // find block ports
- WireEntityStruct wire = signalEngine.MatchBlocksToWire(start.Id, end.Id, out bool exists, startPort, endPort);
- if (exists)
- {
- wireEGID = wire.ID;
- endPortEGID = signalEngine.MatchBlockInputToPort(end, wire.destinationPortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockOutputToPort(start, wire.sourcePortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- inputToOutput = false;
- endPort = wire.destinationPortUsage;
- startPort = wire.sourcePortUsage;
- }
- else
- {
- // flip I/O around and try again
- wire = signalEngine.MatchBlocksToWire(end.Id, start.Id, out exists, endPort, startPort);
- if (exists)
- {
- wireEGID = wire.ID;
- endPortEGID = signalEngine.MatchBlockOutputToPort(end, wire.sourcePortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockInputToPort(start, wire.destinationPortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- inputToOutput = true; // end is actually the source
- // NB: start and end are handled exactly as they're received as params.
- // This makes wire traversal easier, but makes logic in this class a bit more complex
- endPort = wire.sourcePortUsage;
- startPort = wire.destinationPortUsage;
- }
- else
- {
- throw new WireInvalidException("Wire not found");
- }
- }
- }
-
- ///
- /// Construct a wire object from an existing wire connection.
- ///
- /// Starting block ID.
- /// Ending block ID.
- /// Starting port number.
- /// Ending port number.
- /// The wire ID.
- /// Whether the wire direction goes input -> output (true) or output -> input (false, preferred).
- public Wire(Block start, Block end, byte startPort, byte endPort, EGID wire, bool inputToOutput)
- {
- this.startBlockEGID = start.Id;
- this.endBlockEGID = end.Id;
- this.inputToOutput = inputToOutput;
- this.wireEGID = wire;
- if (inputToOutput)
- {
- endPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out bool exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- }
- else
- {
- endPortEGID = signalEngine.MatchBlockInputToPort(end, endPort, out bool exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockOutputToPort(start, startPort, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- }
- this.startPort = startPort;
- this.endPort = endPort;
- }
-
- ///
- /// Construct a wire object from an existing wire connection.
- ///
- /// The wire ID.
- public Wire(EGID wireEgid)
- {
- this.wireEGID = wireEgid;
- WireEntityStruct wire = signalEngine.GetWire(wireEGID);
- this.startBlockEGID = wire.sourceBlockEGID;
- this.endBlockEGID = wire.destinationBlockEGID;
- this.inputToOutput = false;
- endPortEGID = signalEngine.MatchBlockInputToPort(wire.destinationBlockEGID, wire.destinationPortUsage, out bool exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockOutputToPort(wire.sourceBlockEGID, wire.sourcePortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- this.endPort = wire.destinationPortUsage;
- this.startPort = wire.sourcePortUsage;
- }
-
- internal Wire(WireEntityStruct wire, SignalingBlock src, SignalingBlock dest)
- {
- this.wireEGID = wire.ID;
- this.startBlockEGID = wire.sourceBlockEGID;
- this.endBlockEGID = wire.destinationBlockEGID;
- inputToOutput = false;
- endPortEGID = signalEngine.MatchBlockInputToPort(dest, wire.destinationPortUsage, out bool exists);
- if (!exists) throw new WireInvalidException("Wire end port not found");
- startPortEGID = signalEngine.MatchBlockOutputToPort(src, wire.sourcePortUsage, out exists);
- if (!exists) throw new WireInvalidException("Wire start port not found");
- this.endPort = wire.destinationPortUsage;
- this.startPort = wire.sourcePortUsage;
- }
-
- ///
- /// The wire's in-game id.
- ///
- public EGID Id
- {
- get => wireEGID;
- }
-
- ///
- /// The wire's signal value, as a float.
- ///
- public float Float
- {
- get
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return 0f;
- return cds.valueAsFloat;
- }
-
- set
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return;
- cds.valueAsFloat = value;
- }
- }
-
- ///
- /// The wire's string signal.
- ///
- public string String
- {
- get
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return "";
- return cds.valueAsEcsString;
- }
-
- set
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return;
- cds.valueAsEcsString.Set(value);
- }
- }
-
- ///
- /// The wire's raw string signal.
- ///
- public ECSString ECSString
- {
- get
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return default;
- return cds.valueAsEcsString;
- }
-
- set
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return;
- cds.valueAsEcsString = value;
- }
- }
-
- ///
- /// The wire's signal id.
- /// I'm 50% sure this is useless.
- ///
- public uint SignalId
- {
- get
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return uint.MaxValue;
- return cds.valueAsID;
- }
-
- set
- {
- ref ChannelDataStruct cds = ref signalEngine.GetChannelDataStruct(startPortEGID, out bool exists);
- if (!exists) return;
- cds.valueAsID = value;
- }
- }
-
- ///
- /// The block at the beginning of the wire.
- ///
- public SignalingBlock Start
- {
- get => new SignalingBlock(startBlockEGID);
- }
-
- ///
- /// The port number that the beginning of the wire connects to.
- ///
- public byte StartPort
- {
- get => startPort;
- }
-
- ///
- /// The block at the end of the wire.
- ///
- public SignalingBlock End
- {
- get => new SignalingBlock(endBlockEGID);
- }
-
- ///
- /// The port number that the end of the wire connects to.
- ///
- public byte EndPort
- {
- get => endPort;
- }
-
- ///
- /// Create a copy of the wire object where the direction of the wire is guaranteed to be from a block output to a block input.
- /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input).
- ///
- /// A copy of the wire object.
- public Wire OutputToInputCopy()
- {
- return new Wire(wireEGID);
- }
-
- ///
- /// Convert the wire object to the direction the signal flows.
- /// Signals on wires always flow from a block output port to a block input port.
- /// This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input).
- ///
- public void OutputToInputInPlace()
- {
- if (inputToOutput)
- {
- inputToOutput = false;
- // swap inputs and outputs
- EGID temp = endBlockEGID;
- endBlockEGID = startBlockEGID;
- startBlockEGID = temp;
- temp = endPortEGID;
- endPortEGID = startPortEGID;
- startPortEGID = temp;
- byte tempPortNumber = endPort;
- endPort = startPort;
- startPort = tempPortNumber;
- }
- }
-
- public override string ToString()
- {
- if (signalEngine.Exists(wireEGID))
- {
- return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} aka {Start.PortName(StartPort, inputToOutput)}) -> ({End.Type}::{EndPort} aka {End.PortName(EndPort, !inputToOutput)})";
- }
- return $"{nameof(Id)}: {Id}, Start{nameof(Start.Id)}: {Start.Id}, End{nameof(End.Id)}: {End.Id}, ({Start.Type}::{StartPort} -> {End.Type}::{EndPort})";
- }
-
- internal static void Init() { }
- }
-}
\ No newline at end of file
diff --git a/GamecraftModdingAPI/Commands/CommandPatch.cs b/GamecraftModdingAPI/Commands/CommandPatch.cs
deleted file mode 100644
index ab90e6e..0000000
--- a/GamecraftModdingAPI/Commands/CommandPatch.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Reflection;
-
-using HarmonyLib;
-using Svelto.Context;
-using Svelto.ECS;
-using RobocraftX;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Commands
-{
- ///
- /// Patch of RobocraftX.GUI.CommandLine.CommandLineCompositionRoot.Compose()
- ///
- // TODO: fix
- [HarmonyPatch]
- //[HarmonyPatch(typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot))]
- //[HarmonyPatch("Compose")]
- //[HarmonyPatch("Compose", new Type[] { typeof(UnityContext), typeof(EnginesRoot), typeof(World), typeof(Action), typeof(MultiplayerInitParameters), typeof(StateSyncRegistrationHelper)})]
- static class CommandPatch
- {
- public static void Postfix(EnginesRoot enginesRoot)
- {
- // When a game is loaded, register the command engines
- CommandManager.RegisterEngines(enginesRoot);
- }
-
- public static MethodBase TargetMethod(Harmony instance)
- {
- return typeof(RobocraftX.GUI.CommandLine.CommandLineCompositionRoot).GetMethod("Compose").MakeGenericMethod(typeof(object));
- //return func.Method;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Commands/ExistingCommands.cs b/GamecraftModdingAPI/Commands/ExistingCommands.cs
deleted file mode 100644
index 60bd900..0000000
--- a/GamecraftModdingAPI/Commands/ExistingCommands.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-
-using uREPL;
-
-namespace GamecraftModdingAPI.Commands
-{
- public static class ExistingCommands
- {
- public static void Call(string commandName)
- {
- RuntimeCommands.Call(commandName);
- }
-
- public static void Call(string commandName, Arg0 arg0)
- {
- RuntimeCommands.Call(commandName, arg0);
- }
-
- public static void Call(string commandName, Arg0 arg0, Arg1 arg1)
- {
- RuntimeCommands.Call(commandName, arg0, arg1);
- }
-
- public static void Call(string commandName, Arg0 arg0, Arg1 arg1, Arg2 arg2)
- {
- RuntimeCommands.Call(commandName, arg0, arg1, arg2);
- }
-
- public static bool Exists(string commandName)
- {
- return RuntimeCommands.HasRegistered(commandName);
- }
-
- public static string[] GetCommandNames()
- {
- var keys = RuntimeCommands.table.Keys;
- string[] res = new string[keys.Count];
- keys.CopyTo(res, 0);
- return res;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs b/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs
deleted file mode 100644
index 9f16955..0000000
--- a/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-
-using HarmonyLib;
-using Svelto.ECS;
-using RobocraftX.Common;
-using RobocraftX.StateSync;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...)
- ///
- //[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "DeterministicCompose")]
- [Obsolete]
- [HarmonyPatch]
- class GameHostTransitionDeterministicGroupEnginePatch
- {
-
- public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
-
- public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
-
- public static void Postfix()
- {
- //stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
- //stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
- //enginesRoot.AddEngine(buildEngine);
- //enginesRoot.AddEngine(simEngine);
- buildEngine.EmitIfBuildMode();
- simEngine.EmitIfSimMode();
- }
-
- [HarmonyTargetMethod]
- public static MethodBase TargetMethod(Harmony harmonyInstance)
- {
- return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
- //.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/EmitterBuilder.cs b/GamecraftModdingAPI/Events/EmitterBuilder.cs
deleted file mode 100644
index c6a6879..0000000
--- a/GamecraftModdingAPI/Events/EmitterBuilder.cs
+++ /dev/null
@@ -1,106 +0,0 @@
-using System;
-
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Events
-{
- [Obsolete]
- public class EmitterBuilder
- {
- private string name;
-
- private int? type;
-
- ///
- /// Create a new event emitter builder.
- ///
- public EmitterBuilder()
- {
- }
-
- ///
- /// Create a new event emitter builder.
- /// This is equivalent to new EmitterBuilder().Name(name)
- ///
- /// The emitter name.
- public EmitterBuilder(string name)
- {
- this.name = name;
- }
-
- ///
- /// Create and return an event emitter builder.
- ///
- /// The builder.
- public static EmitterBuilder Builder()
- {
- return new EmitterBuilder();
- }
-
- ///
- /// Create and return an event emitter builder.
- /// This is equivalent to Builder().Name(name)
- ///
- /// The builder.
- /// The emitter name.
- public static EmitterBuilder Builder(string name)
- {
- return new EmitterBuilder(name);
- }
-
- ///
- /// Name the event emitter.
- ///
- /// The builder.
- /// The event emitter name.
- public EmitterBuilder Name(string name)
- {
- this.name = name;
- return this;
- }
-
- ///
- /// Set the type of event to handle.
- ///
- /// The builder.
- /// The event type.
- public EmitterBuilder Handle(EventType eventType)
- {
- return Handle((int)eventType);
- }
-
- ///
- /// Set the type of event to handle.
- ///
- /// The builder.
- /// The event type.
- public EmitterBuilder Handle(int eventType)
- {
- this.type = eventType;
- return this;
- }
-
- ///
- /// Build the event emitter.
- ///
- /// The event emitter.
- /// Automatically register the event emitter with EventManager.AddEventemitter().
- public IEventEmitterEngine Build(bool register = true)
- {
- if (string.IsNullOrWhiteSpace(name))
- {
- throw new EventParameterMissingException("Event emitter name must be defined before Build() is called");
- }
- if (!type.HasValue)
- {
- throw new EventParameterMissingException("Event emitter event type must be defined before Build() is called");
- }
- SimpleEventEmitterEngine result = new SimpleEventEmitterEngine(type.Value, name);
- if (register)
- {
- EventManager.AddEventEmitter(result);
- }
- return result;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/EventEngineFactory.cs b/GamecraftModdingAPI/Events/EventEngineFactory.cs
deleted file mode 100644
index 7981303..0000000
--- a/GamecraftModdingAPI/Events/EventEngineFactory.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Convenient factories for mod event engines
- ///
- [Obsolete]
- public static class EventEngineFactory
- {
- ///
- /// Factory method which automatically adds the SimpleEventHandlerEngine to the Manager
- ///
- /// The name of the engine
- /// The type of event to handle
- /// The operation to do when the event is created
- /// The operation to do when the event is destroyed (if applicable)
- /// The created object
- public static SimpleEventHandlerEngine CreateAddSimpleHandler(string name, int type, Action onActivated, Action onDestroyed)
- {
- var engine = new SimpleEventHandlerEngine(onActivated, onDestroyed, type, name);
- EventManager.AddEventHandler(engine);
- return engine;
- }
-
- ///
- /// Factory method which automatically adds the SimpleEventHandlerEngine to the Manager
- ///
- /// The name of the engine
- /// The type of event to handle
- /// The operation to do when the event is created
- /// The operation to do when the event is destroyed (if applicable)
- /// The created object
- public static SimpleEventHandlerEngine CreateAddSimpleHandler(string name, int type, Action onActivated, Action onDestroyed)
- {
- var engine = new SimpleEventHandlerEngine(onActivated, onDestroyed, type, name);
- EventManager.AddEventHandler(engine);
- return engine;
- }
-
- ///
- /// Factory method which automatically adds the SimpleEventEmitterEngine to the Manager
- ///
- /// The name of the engine
- /// The type of event to emit
- /// Will removing this engine not break your code?
- /// The created object
- public static SimpleEventEmitterEngine CreateAddSimpleEmitter(string name, int type, bool isRemovable = true)
- {
- var engine = new SimpleEventEmitterEngine(type, name, isRemovable);
- EventManager.AddEventEmitter(engine);
- return engine;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/EventExceptions.cs b/GamecraftModdingAPI/Events/EventExceptions.cs
deleted file mode 100644
index b4458bc..0000000
--- a/GamecraftModdingAPI/Events/EventExceptions.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-namespace GamecraftModdingAPI.Events
-{
- public class EventException : GamecraftModdingAPIException
- {
- public EventException()
- {
- }
-
- public EventException(string message) : base(message)
- {
- }
-
- public EventException(string message, Exception innerException) : base(message, innerException)
- {
- }
- }
-
- public class EventNotFoundException : EventException
- {
- public EventNotFoundException()
- {
- }
-
- public EventNotFoundException(string message) : base(message)
- {
- }
- }
-
- public class EventAlreadyExistsException : EventException
- {
- public EventAlreadyExistsException()
- {
- }
-
- public EventAlreadyExistsException(string message) : base(message)
- {
- }
- }
-
- public class EventRuntimeException : EventException
- {
- public EventRuntimeException()
- {
- }
-
- public EventRuntimeException(string message) : base(message)
- {
- }
-
- public EventRuntimeException(string message, Exception innerException) : base(message, innerException)
- {
- }
- }
-
- public class EventParameterMissingException : EventException
- {
- public EventParameterMissingException()
- {
- }
-
- public EventParameterMissingException(string message) : base(message)
- {
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/EventManager.cs b/GamecraftModdingAPI/Events/EventManager.cs
deleted file mode 100644
index f021e9f..0000000
--- a/GamecraftModdingAPI/Events/EventManager.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Keeps track of event handlers and emitters.
- /// This is used to add, remove and get API event handlers and emitters.
- ///
- [Obsolete("This will be removed in an upcoming update. Use the new C# event architecture from GamecraftModdingAPI.App")]
- public static class EventManager
- {
- private static Dictionary _eventEmitters = new Dictionary();
-
- private static Dictionary _eventHandlers = new Dictionary();
-
- private static EnginesRoot _lastEngineRoot;
-
- // event handler management
-
- public static void AddEventHandler(IEventHandlerEngine engine)
- {
- if (ExistsEventHandler(engine))
- {
- throw new EventAlreadyExistsException($"IEventHandlerEngine {engine.Name} already exists");
- }
- _eventHandlers[engine.Name] = engine;
- if (_lastEngineRoot != null)
- {
- Logging.MetaDebugLog($"Registering IEventHandlerEngine {engine.Name}");
- _lastEngineRoot.AddEngine(engine);
- }
- }
-
- public static bool ExistsEventHandler(string name)
- {
- return _eventHandlers.ContainsKey(name);
- }
-
- public static bool ExistsEventHandler(IEventHandlerEngine engine)
- {
- return ExistsEventHandler(engine.Name);
- }
-
- public static IEventHandlerEngine GetEventHandler(string name)
- {
- return _eventHandlers[name];
- }
-
- public static string[] GetEventHandlerNames()
- {
- return _eventHandlers.Keys.ToArray();
- }
-
- public static void RemoveEventHandler(string name)
- {
- _eventHandlers.Remove(name);
- }
-
- // event emitter management
-
- public static void AddEventEmitter(IEventEmitterEngine engine)
- {
- if (ExistsEventEmitter(engine))
- {
- throw new EventAlreadyExistsException($"IEventEmitterEngine {engine.Name} already exists");
- }
- _eventEmitters[engine.Name] = engine;
- if (_lastEngineRoot != null)
- {
- Logging.MetaDebugLog($"Registering IEventEmitterEngine {engine.Name}");
- _lastEngineRoot.AddEngine(engine);
- }
- }
-
- public static bool ExistsEventEmitter(string name)
- {
- return _eventEmitters.ContainsKey(name);
- }
-
- public static bool ExistsEventEmitter(IEventEmitterEngine engine)
- {
- return ExistsEventEmitter(engine.Name);
- }
-
- public static IEventEmitterEngine GetEventEmitter(string name)
- {
- return _eventEmitters[name];
- }
-
- public static string[] GetEventEmitterNames()
- {
- return _eventEmitters.Keys.ToArray();
- }
-
- public static void RemoveEventEmitter(string name)
- {
- if (_eventEmitters[name].isRemovable)
- {
- _eventEmitters.Remove(name);
- }
- }
-
- public static void RegisterEngines(EnginesRoot enginesRoot)
- {
- _lastEngineRoot = enginesRoot;
- // Register handlers before emitters so no events are missed
- var entityFactory = enginesRoot.GenerateEntityFactory();
- foreach (var key in _eventHandlers.Keys)
- {
- Logging.MetaDebugLog($"Registering IEventHandlerEngine {_eventHandlers[key].Name}");
- enginesRoot.AddEngine(_eventHandlers[key]);
- }
- foreach (var key in _eventEmitters.Keys)
- {
- Logging.MetaDebugLog($"Registering IEventEmitterEngine {_eventEmitters[key].Name}");
- _eventEmitters[key].Factory = entityFactory;
- enginesRoot.AddEngine(_eventEmitters[key]);
- }
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/EventType.cs b/GamecraftModdingAPI/Events/EventType.cs
deleted file mode 100644
index 468e214..0000000
--- a/GamecraftModdingAPI/Events/EventType.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Built-in event types.
- /// These are configured to fire when the API is initialized.
- ///
- public enum EventType
- {
- ApplicationInitialized,
- Menu,
- MenuSwitchedTo,
- Game,
- GameReloaded,
- GameSwitchedTo,
- SimulationSwitchedTo,
- BuildSwitchedTo
- }
-}
diff --git a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs b/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs
deleted file mode 100644
index c3a5fb5..0000000
--- a/GamecraftModdingAPI/Events/GameActivatedComposePatch.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-
-using HarmonyLib;
-using RobocraftX.CR.MainGame;
-using Svelto.ECS;
-using Unity.Entities;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame()
- ///
- [Obsolete]
- [HarmonyPatch]
- class GameActivatedComposePatch
- {
- public static bool IsGameSwitching = false;
-
- public static bool IsGameReloading = false;
-
- public static void Postfix(ref object contextHolder, ref EnginesRoot enginesRoot, World physicsWorld)
- {
- // register custom game engines
- GameEngineManager.RegisterEngines(enginesRoot);
- // initialize AsyncUtils
- AsyncUtils.Setup(enginesRoot);
- // A new EnginesRoot is always created when ActivateGame is called
- // so all event emitters and handlers must be re-registered.
- EventManager.RegisterEngines(enginesRoot);
- Logging.Log("Dispatching Game Activated event");
- EventManager.GetEventEmitter("GamecraftModdingAPIGameActivatedEventEmitter").Emit();
- if (IsGameSwitching)
- {
- IsGameSwitching = false;
- Logging.Log("Dispatching Game Switched To event");
- EventManager.GetEventEmitter("GamecraftModdingAPIGameSwitchedToEventEmitter").Emit();
- }
- if (IsGameReloading)
- {
- IsGameReloading = false;
- Logging.Log("Dispatching Game Reloaded event");
- EventManager.GetEventEmitter("GamecraftModdingAPIGameReloadedEventEmitter").Emit();
- }
- }
-
- public static MethodBase TargetMethod()
- {
- return typeof(MainGameCompositionRoot).GetMethods().First(m => m.Name == "Compose")
- .MakeGenericMethod(typeof(object));
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/GameReloadedPatch.cs b/GamecraftModdingAPI/Events/GameReloadedPatch.cs
deleted file mode 100644
index 7228084..0000000
--- a/GamecraftModdingAPI/Events/GameReloadedPatch.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using HarmonyLib;
-using RobocraftX;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.FullGameCompositionRoot.ReloadGame()
- ///
- [Obsolete]
- [HarmonyPatch(typeof(FullGameCompositionRoot), "ReloadGame")]
- class GameReloadedPatch
- {
- public static void Postfix()
- {
- GameActivatedComposePatch.IsGameReloading = true;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs
deleted file mode 100644
index 725f544..0000000
--- a/GamecraftModdingAPI/Events/GameStateBuildEmitterEngine.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-
-using Unity.Jobs;
-using RobocraftX.SimulationModeState;
-using RobocraftX.StateSync;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Event emitter engine for switching to to build mode.
- ///
- [Obsolete]
- public class GameStateBuildEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeStoppedModeEntered
- {
- public string Name { get; } = "GamecraftModdingAPIGameStateBuildEventEmitter" ;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public int type { get; } = (int)EventType.BuildSwitchedTo;
-
- public bool isRemovable { get; } = false;
-
- public IEntityFactory Factory { set; private get; }
-
- public void Dispose() { }
-
- public void Emit()
- {
- Logging.Log("Dispatching Build Switched To event");
- if (Factory == null) { return; }
- Factory.BuildEntity(ApiExclusiveGroups.eventID++, ApiExclusiveGroups.eventsExclusiveGroup)
- .Init(new ModEventEntityStruct { type = type });
- }
-
- public void EmitIfBuildMode()
- {
- //Logging.MetaDebugLog($"nextSimulationMode: {entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode}");
- if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.TimeStopped)
- {
- Emit();
- }
- }
-
- public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps)
- {
- Emit();
- return inputDeps;
- }
-
- public void Ready() { }
- }
-}
diff --git a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs b/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs
deleted file mode 100644
index 6e6e2ce..0000000
--- a/GamecraftModdingAPI/Events/GameStateSimulationEmitterEngine.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-
-using Unity.Jobs;
-using RobocraftX.SimulationModeState;
-using RobocraftX.StateSync;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Event emitter engine for switching to simulation mode.
- ///
- [Obsolete]
- public class GameStateSimulationEmitterEngine : IEventEmitterEngine, IUnorderedInitializeOnTimeRunningModeEntered
- {
- public string Name { get; } = "GamecraftModdingAPIGameStateSimulationEventEmitter" ;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public int type { get; } = (int)EventType.SimulationSwitchedTo;
-
- public bool isRemovable { get; } = false;
-
- public IEntityFactory Factory { set; private get; }
-
- public void Dispose() { }
-
- public void Emit()
- {
- Logging.Log("Dispatching Simulation Switched To event");
- if (Factory == null) { return; }
- Factory.BuildEntity(ApiExclusiveGroups.eventID++, ApiExclusiveGroups.eventsExclusiveGroup)
- .Init(new ModEventEntityStruct { type = type });
- }
-
- public void EmitIfSimMode()
- {
- if (entitiesDB.QueryUniqueEntity(SimulationModeStateExclusiveGroups.GAME_STATE_GROUP).nextSimulationMode == SimulationMode.TimeRunning)
- {
- Emit();
- }
- }
-
- public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps)
- {
- Emit();
- return inputDeps;
- }
-
- public void Ready() { }
- }
-}
diff --git a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs b/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs
deleted file mode 100644
index dbd63c0..0000000
--- a/GamecraftModdingAPI/Events/GameSwitchedToPatch.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Reflection;
-
-using HarmonyLib;
-using RobocraftX;
-using RobocraftX.CR.MainGame;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.FullGameCompositionRoot.ActivateGame()
- /// (scheduled for execution during RobocraftX.FullGameCompositionRoot.SwitchToGame())
- ///
- [Obsolete]
- [HarmonyPatch(typeof(FullGameCompositionRoot), "SwitchToGame")]
- class GameSwitchedToPatch
- {
- public static void Prefix()
- {
- GameActivatedComposePatch.IsGameSwitching = true;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/HandlerBuilder.cs b/GamecraftModdingAPI/Events/HandlerBuilder.cs
deleted file mode 100644
index 10f3290..0000000
--- a/GamecraftModdingAPI/Events/HandlerBuilder.cs
+++ /dev/null
@@ -1,166 +0,0 @@
-using System;
-
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Events
-{
- [Obsolete]
- public class HandlerBuilder
- {
- private string name;
-
- private int? type;
-
- private Action activated;
-
- private Action destroyed;
-
- ///
- /// Create a new event handler builder.
- ///
- public HandlerBuilder()
- {
- }
-
- ///
- /// Create a new event handler builder.
- /// This is equivalent to new HandlerBuilder().Name(name)
- ///
- /// The handler name.
- public HandlerBuilder(string name)
- {
- this.name = name;
- }
-
- ///
- /// Create and return an event handler builder.
- ///
- /// The builder.
- public static HandlerBuilder Builder()
- {
- return new HandlerBuilder();
- }
-
- ///
- /// Create and return an event handler builder.
- /// This is equivalent to Builder().Name(name)
- ///
- /// The builder.
- /// The handler name.
- public static HandlerBuilder Builder(string name)
- {
- return new HandlerBuilder(name);
- }
-
- ///
- /// Name the event handler.
- ///
- /// The builder.
- /// The event handler name.
- public HandlerBuilder Name(string name)
- {
- this.name = name;
- return this;
- }
-
- ///
- /// Set the action to perform on when the activated event occurs.
- ///
- /// The builder.
- /// The activated event action.
- public HandlerBuilder OnActivation(Action action)
- {
- return OnActivation((_) => { action(); });
- }
-
- ///
- /// Set the action to perform on when the activated event occurs.
- ///
- /// The builder.
- /// The activated event action.
- public HandlerBuilder OnActivation(Action action)
- {
- this.activated = action;
- return this;
- }
-
- ///
- /// Set the action to perform when the destroyed event occurs.
- ///
- /// The builder.
- /// The destroyed event action.
- public HandlerBuilder OnDestruction(Action action)
- {
- return OnDestruction((_) => { action(); });
- }
-
- ///
- /// Set the action to perform when the destroyed event occurs.
- ///
- /// The builder.
- /// The destroyed event action.
- public HandlerBuilder OnDestruction(Action action)
- {
- this.destroyed = action;
- return this;
- }
-
- ///
- /// Set the type of event to handle.
- ///
- /// The builder.
- /// The event type.
- public HandlerBuilder Handle(EventType eventType)
- {
- return Handle((int)eventType);
- }
-
- ///
- /// Set the type of event to handle.
- ///
- /// The builder.
- /// The event type.
- public HandlerBuilder Handle(int eventType)
- {
- this.type = eventType;
- return this;
- }
-
- ///
- /// Build the event handler.
- ///
- /// The event handler.
- /// Automatically register the event handler with EventManager.AddEventHandler().
- public IEventHandlerEngine Build(bool register = true)
- {
- if (string.IsNullOrWhiteSpace(name))
- {
- throw new EventParameterMissingException("Event handler name must be defined before Build() is called");
- }
- if (activated == null && destroyed == null)
- {
- throw new EventParameterMissingException("Event handler destruction or activated event action must be defined before Build() is called");
- }
- if (!type.HasValue)
- {
- throw new EventParameterMissingException("Event handler event type must be defined before Build() is called");
- }
- Action validActivated = activated;
- if (validActivated == null)
- {
- validActivated = (_) => { };
- }
- Action validDestroyed = destroyed;
- if (validDestroyed == null)
- {
- validDestroyed = (_) => { };
- }
- SimpleEventHandlerEngine result = new SimpleEventHandlerEngine(validActivated, validDestroyed, type.Value, name);
- if (register)
- {
- EventManager.AddEventHandler(result);
- }
- return result;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs b/GamecraftModdingAPI/Events/IEventEmitterEngine.cs
deleted file mode 100644
index 8917cef..0000000
--- a/GamecraftModdingAPI/Events/IEventEmitterEngine.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Engine interface to create a ModEventEntityStruct in entitiesDB when a specific event occurs.
- ///
- [Obsolete]
- public interface IEventEmitterEngine : IFactoryEngine
- {
- ///
- /// Emit the event. (Optional)
- ///
- void Emit();
- }
-}
diff --git a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs b/GamecraftModdingAPI/Events/IEventHandlerEngine.cs
deleted file mode 100644
index 228adb8..0000000
--- a/GamecraftModdingAPI/Events/IEventHandlerEngine.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-using Svelto.ECS.Internal;
-
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Engine interface to handle ModEventEntityStruct events emitted by IEventEmitterEngines.
- ///
- [Obsolete]
- public interface IEventHandlerEngine : IReactionaryEngine
- {
- }
-}
diff --git a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs b/GamecraftModdingAPI/Events/MenuActivatedPatch.cs
deleted file mode 100644
index 382bac4..0000000
--- a/GamecraftModdingAPI/Events/MenuActivatedPatch.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using HarmonyLib;
-using RobocraftX;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.FullGameCompositionRoot.ActivateMenu()
- ///
- [Obsolete]
- [HarmonyPatch(typeof(FullGameCompositionRoot), "ActivateMenu")]
- class MenuActivatedPatch
- {
-
- private static bool firstLoad = true;
- public static void Postfix(ref EnginesRoot ____frontEndEnginesRoot, FullGameCompositionRoot __instance)
- {
- // register custom menu engines
- MenuEngineManager.RegisterEngines(____frontEndEnginesRoot);
- // A new EnginesRoot is always created when ActivateMenu is called
- // so all event emitters and handlers must be re-registered.
- EventManager.RegisterEngines(____frontEndEnginesRoot);
- if (firstLoad)
- {
- firstLoad = false;
- FullGameFields.Init(__instance);
- //Application.Application.SetFullGameCompositionRoot(__instance);
- Logging.Log("Dispatching App Init event");
- EventManager.GetEventEmitter("GamecraftModdingAPIApplicationInitializedEventEmitter").Emit();
- }
- Logging.Log("Dispatching Menu Activated event");
- EventManager.GetEventEmitter("GamecraftModdingAPIMenuActivatedEventEmitter").Emit();
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs b/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs
deleted file mode 100644
index 30b84da..0000000
--- a/GamecraftModdingAPI/Events/MenuSwitchedToPatch.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using HarmonyLib;
-using RobocraftX;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// Patch of RobocraftX.FullGameCompositionRoot.SwitchToMenu()
- ///
- [Obsolete]
- [HarmonyPatch(typeof(FullGameCompositionRoot), "SwitchToMenu")]
- class MenuSwitchedToPatch
- {
- public static void Postfix()
- {
- // Event emitters and handlers should already be registered by MenuActivated event
- Logging.Log("Dispatching Menu Switched To event");
- EventManager.GetEventEmitter("GamecraftModdingAPIMenuSwitchedToEventEmitter").Emit();
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs b/GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs
deleted file mode 100644
index 5172d9c..0000000
--- a/GamecraftModdingAPI/Events/ModEventEntityDescriptor.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// EntityDescriptor for creating ModEventEntityStructs
- ///
- public class ModEventEntityDescriptor : GenericEntityDescriptor
- {
- }
-}
diff --git a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs b/GamecraftModdingAPI/Events/ModEventEntityStruct.cs
deleted file mode 100644
index cc945ec..0000000
--- a/GamecraftModdingAPI/Events/ModEventEntityStruct.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// The event entity struct
- ///
- public struct ModEventEntityStruct : IEntityComponent, INeedEGID
- {
- ///
- /// The type of event that has been emitted
- ///
- public int type;
-
- public EGID ID { get; set; }
- }
-}
diff --git a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs b/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs
deleted file mode 100644
index 0ea8170..0000000
--- a/GamecraftModdingAPI/Events/SimpleEventEmitterEngine.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// A simple implementation of IEventEmitterEngine sufficient for most uses
- ///
- [Obsolete]
- public class SimpleEventEmitterEngine : IEventEmitterEngine
- {
- public string Name { get; set; }
- public int type { get; set; }
-
- public bool isRemovable { get; }
-
- public IEntityFactory Factory { private get; set; }
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public void Ready() { }
-
- ///
- /// Emit the event
- ///
- public void Emit()
- {
- Factory.BuildEntity(ApiExclusiveGroups.eventID++, ApiExclusiveGroups.eventsExclusiveGroup)
- .Init(new ModEventEntityStruct { type = type });
- }
-
- public void Dispose() { }
-
- ///
- /// Construct the engine
- ///
- /// The EventType to use for ModEventEntityStruct.type
- /// The name of this engine
- /// Will removing this engine not break your code?
- public SimpleEventEmitterEngine(EventType type, string name, bool isRemovable = true)
- {
- this.type = (int)type;
- this.Name = name;
- this.isRemovable = isRemovable;
- }
-
- ///
- /// Construct the engine
- ///
- /// The object to use for ModEventEntityStruct.type
- /// The name of this engine
- /// Will removing this engine not break your code?
- public SimpleEventEmitterEngine(int type, string name, bool isRemovable = true)
- {
- this.type = type;
- this.Name = name;
- this.isRemovable = isRemovable;
- }
- }
-}
diff --git a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs b/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs
deleted file mode 100644
index ebce21d..0000000
--- a/GamecraftModdingAPI/Events/SimpleEventHandlerEngine.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-
-namespace GamecraftModdingAPI.Events
-{
- ///
- /// A simple implementation of IEventHandlerEngine sufficient for most uses
- ///
- [Obsolete]
- public class SimpleEventHandlerEngine : IEventHandlerEngine
- {
- public int type { get; set; }
- public string Name { get; set; }
-
- private bool isActivated = false;
-
- private bool jankActivateFix = false;
-
- private bool jankDestroyFix = false;
-
- private readonly Action onActivated;
-
- private readonly Action onDestroyed;
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => true;
-
- public void Add(ref ModEventEntityStruct entityView, EGID egid)
- {
- if (entityView.type.Equals(this.type))
- {
- jankActivateFix = !jankActivateFix;
- if (jankActivateFix) return;
- isActivated = true;
- onActivatedInvokeCatchError(entitiesDB);
- }
- }
-
- ///
- /// Manually activate the EventHandler.
- /// Once activated, the next remove event will not be ignored.
- ///
- /// Whether to invoke the activated action
- public void Activate(bool handle = false)
- {
- isActivated = true;
- if (handle && entitiesDB != null)
- {
- onActivatedInvokeCatchError(entitiesDB);
- }
- }
-
- public void Deactivate()
- {
- isActivated = false;
- }
-
- public void Ready() { }
-
- public void Remove(ref ModEventEntityStruct entityView, EGID egid)
- {
- if (entityView.type.Equals(this.type) && isActivated)
- {
- jankDestroyFix = !jankDestroyFix;
- if (jankDestroyFix) return;
- isActivated = false;
- onDestroyedInvokeCatchError(entitiesDB);
- }
- }
-
- public void Dispose()
- {
- if (isActivated)
- {
- isActivated = false;
- onDestroyedInvokeCatchError(entitiesDB);
- }
- }
-
- ///
- /// Construct the engine
- ///
- /// The operation to do when the event is created
- /// The operation to do when the event is destroyed (if applicable)
- /// The type of event to handle
- /// The name of the engine
- /// A useless parameter to use to avoid Python overload resolution errors
- public SimpleEventHandlerEngine(Action activated, Action removed, int type, string name, bool simple = true)
- : this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, type, name) { }
-
- ///
- /// Construct the engine
- ///
- /// The operation to do when the event is created
- /// The operation to do when the event is destroyed (if applicable)
- /// The type of event to handler
- /// The name of the engine
- public SimpleEventHandlerEngine(Action activated, Action removed, int type, string name)
- {
- this.type = type;
- this.Name = name;
- this.onActivated = activated;
- this.onDestroyed = removed;
- }
-
- private void onActivatedInvokeCatchError(EntitiesDB _entitiesDB)
- {
- try
- {
- onActivated.Invoke(_entitiesDB);
- }
- catch (Exception e)
- {
- EventRuntimeException wrappedException = new EventRuntimeException($"EventHandler {Name} threw an exception when activated", e);
- Logging.LogWarning(wrappedException.ToString());
- }
- }
-
- private void onDestroyedInvokeCatchError(EntitiesDB _entitiesDB)
- {
- try
- {
- onDestroyed.Invoke(_entitiesDB);
- }
- catch (Exception e)
- {
- EventRuntimeException wrappedException = new EventRuntimeException($"EventHandler {Name} threw an exception when destroyed", e);
- Logging.LogWarning(wrappedException.ToString());
- }
- }
-
- public SimpleEventHandlerEngine(Action activated, Action removed, EventType type, string name, bool simple = true)
- : this((EntitiesDB _) => { activated.Invoke(); }, (EntitiesDB _) => { removed.Invoke(); }, (int)type, name) { }
-
- public SimpleEventHandlerEngine(Action activated, Action removed, EventType type, string name, bool simple = true)
- : this(activated, removed, (int)type, name) { }
- }
-}
diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj
deleted file mode 100644
index cdbb4d9..0000000
--- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj
+++ /dev/null
@@ -1,1061 +0,0 @@
-
-
- net472
- true
- 1.7.0
- Exmods
- GNU General Public Licence 3+
- https://git.exmods.org/modtainers/GamecraftModdingAPI
- en-CA
- true
-
-
-
-
-
-
- DEBUG;TEST;TRACE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll
- ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll
- ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Analytics.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Analytics.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp-firstpass.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp-firstpass.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Assembly-CSharp.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Authentication.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Authentication.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Blocks.HUDFeedbackBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\CommandLine.dll
- ..\..\ref\GamecraftPreview_Data\Managed\CommandLine.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll
- ..\..\ref\GamecraftPreview_Data\Managed\CommandLineCompositionRoot.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll
- ..\..\ref\GamecraftPreview_Data\Managed\ConsoleBlockComposotionRoot.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll
- ..\..\ref\GamecraftPreview_Data\Managed\ConsoleCommand.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\DataLoader.dll
- ..\..\ref\GamecraftPreview_Data\Managed\DataLoader.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\DDNA.dll
- ..\..\ref\GamecraftPreview_Data\Managed\DDNA.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Facepunch.Steamworks.Win64.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Facepunch.Steamworks.Win64.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\FMOD.dll
- ..\..\ref\GamecraftPreview_Data\Managed\FMOD.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\FullGame.dll
- ..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockGroups.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockGroups.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DamagingSurfaceBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.DestructionBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.GenericPhysicsBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LightBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.LogicBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\GameCraft.Blocks.ProjectileBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TextBlock.CompositionRoot.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerabilityGui.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.ColourPalette.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.ColourPalette.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Damage.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Effects.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.ExplosionFragments.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GraphicsSettings.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintInventory.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintInventoryMock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Blueprints.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.BlueprintSets.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Colours.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.HUDFeedbackBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.ModeBar.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.OptionsScreen.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Blueprints.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Colours.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TabsBar.Common.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.TimeModeClock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Tweaks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Wires.Mockup.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.JointBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Music.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PerformanceWarnings.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupBlck.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PickupsCommon.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.PopupMessage.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Projectiles.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Tweaks.Mockup.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.Decals.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.VisualEffects.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Wires.Mockup.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\GameState.dll
- ..\..\ref\GamecraftPreview_Data\Managed\GameState.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\GhostShark.Outline.dll
- ..\..\ref\GamecraftPreview_Data\Managed\GhostShark.Outline.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\GPUInstancer.dll
- ..\..\ref\GamecraftPreview_Data\Managed\GPUInstancer.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\LZ4.dll
- ..\..\ref\GamecraftPreview_Data\Managed\LZ4.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\mscorlib.dll
- ..\..\ref\GamecraftPreview_Data\Managed\mscorlib.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\MultiplayerNetworking.dll
- ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerNetworking.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll
- ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Rewired_Core.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Rewired_Core.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Rewired_Windows.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Rewired_Windows.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftECS.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftECS.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.AccountPreferences.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.AccountPreferences.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Ghost.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Blocks.Triggers.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.BoxSelect.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.Jobs.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Building.Jobs.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Character.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Character.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Crosshair.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Crosshair.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.FrontEnd.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.FrontEnd.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.BlockLabel.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.DebugDisplay.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Hotbar.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.BlocksInventory.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.ColourInventory.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.Inventory.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.RemoveBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.ScaleGhost.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUI.TabsBar.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainGame.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainGame.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainSimulation.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MainSimulation.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MockCharacter.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MockCharacter.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.GUI.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.MultiplayerInput.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MultiplayerInput.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Robocraftx.ObjectIdBlocks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Party.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Party.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.PartyGui.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.PartyGui.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Physics.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Physics.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.PilotSeat.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.PilotSeat.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveAndLoad.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveAndLoad.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveGameDialog.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SaveGameDialog.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Serializers.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Serializers.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Services.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Services.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.SignalHandling.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.SignalHandling.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX.StateSync.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.StateSync.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX_SpawnPoints.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX_SpawnPoints.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocraftX_TextBlock.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX_TextBlock.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll
- ..\..\ref\GamecraftPreview_Data\Managed\RobocratX.SimulationMockCompositionRoot.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll
- ..\..\ref\GamecraftPreview_Data\Managed\SpawningPointCompositionRoot.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll
- ..\..\ref\GamecraftPreview_Data\Managed\SpecializedDescriptors.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll
- ..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.MemoryProfiler.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Physics.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Platforms.Common.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Postprocessing.Runtime.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Runtime.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipelines.Universal.Shaders.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Serialization.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.TextMeshPro.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Timeline.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AccessibilityModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AccessibilityModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AIModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AIModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AndroidJNIModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AnimationModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AnimationModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ARModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ARModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AssetBundleModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AssetBundleModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.AudioModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.AudioModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClothModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClothModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterInputModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterInputModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ClusterRendererModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.CoreModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.CoreModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.CrashReportingModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.CrashReportingModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.GameCenterModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.GameCenterModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.GridModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.GridModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.HotReloadModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.HotReloadModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ImageConversionModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ImageConversionModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.IMGUIModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.IMGUIModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputLegacyModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputLegacyModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.InputModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.JSONSerializeModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.LocalizationModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.LocalizationModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ParticleSystemModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PerformanceReportingModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ScreenCaptureModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SharedInternalsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteMaskModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SpriteShapeModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.StreamingModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.StreamingModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubstanceModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubstanceModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubsystemsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.SubsystemsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TerrainPhysicsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextCoreModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextCoreModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextRenderingModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TextRenderingModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UmbraModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UmbraModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UNETModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UNETModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityAnalyticsModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityConnectModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityConnectModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityTestProtocolModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VehiclesModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VehiclesModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VFXModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VFXModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.WindModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.WindModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll
- ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.XRModule.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\uREPL.dll
- ..\..\ref\GamecraftPreview_Data\Managed\uREPL.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll
- ..\..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Accessibility.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\JWT.dll
- ..\..\ref\GamecraftPreview_Data\Managed\JWT.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\netstandard.dll
- ..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll
-
-
- ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll
- ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll
-
-
-
-
\ No newline at end of file
diff --git a/GamecraftModdingAPI/GamecraftModdingAPIException.cs b/GamecraftModdingAPI/GamecraftModdingAPIException.cs
deleted file mode 100644
index bc944aa..0000000
--- a/GamecraftModdingAPI/GamecraftModdingAPIException.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-
-namespace GamecraftModdingAPI
-{
- public class GamecraftModdingAPIException : Exception
- {
- public GamecraftModdingAPIException()
- {
- }
-
- public GamecraftModdingAPIException(string message) : base(message)
- {
- }
-
- public GamecraftModdingAPIException(string message, Exception innerException) : base(message, innerException)
- {
- }
-
- protected GamecraftModdingAPIException(SerializationInfo info, StreamingContext context) : base(info, context)
- {
- }
- }
-}
diff --git a/GamecraftModdingAPI/Input/FakeInputEngine.cs b/GamecraftModdingAPI/Input/FakeInputEngine.cs
deleted file mode 100644
index 11d5f3a..0000000
--- a/GamecraftModdingAPI/Input/FakeInputEngine.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-
-using RobocraftX.Common.Input;
-using RobocraftX.Players;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Utility;
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Input
-{
- public class FakeInputEngine : IApiEngine
- {
- public string Name { get; } = "GamecraftModdingAPIFakeInputEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public bool IsReady = false;
-
- public void Dispose()
- {
- IsReady = false;
- }
-
- public void Ready()
- {
- IsReady = true;
- }
-
- public bool SendCustomInput(LocalInputEntityStruct input, uint playerID, bool remote = false)
- {
- EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers);
- if (entitiesDB.Exists(egid))
- {
- ref LocalInputEntityStruct ies = ref entitiesDB.QueryEntity(egid);
- ies = input;
- return true;
- }
- else return false;
- }
-
- public LocalInputEntityStruct GetInput(uint playerID, bool remote = false)
- {
- EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers);
- if (entitiesDB.Exists(egid))
- {
- return entitiesDB.QueryEntity(egid);
- }
- else return default(LocalInputEntityStruct);
- }
-
- public ref LocalInputEntityStruct GetInputRef(uint playerID, bool remote = false)
- {
- EGID egid = new EGID(playerID, remote ? InputExclusiveGroups.RemotePlayers : InputExclusiveGroups.LocalPlayers);
- return ref entitiesDB.QueryEntity(egid);
- }
-
- public uint GetLocalPlayerID()
- {
- return LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB);
- }
- }
-}
diff --git a/GamecraftModdingAPI/Inventory/Hotbar.cs b/GamecraftModdingAPI/Inventory/Hotbar.cs
deleted file mode 100644
index 838c554..0000000
--- a/GamecraftModdingAPI/Inventory/Hotbar.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-
-using RobocraftX.Common.Input;
-using RobocraftX.Multiplayer.Input;
-
-using GamecraftModdingAPI.Blocks;
-using GamecraftModdingAPI.Utility;
-using HarmonyLib;
-
-namespace GamecraftModdingAPI.Inventory
-{
- public static class Hotbar
- {
- private static readonly HotbarEngine hotbarEngine = new HotbarEngine();
-
- ///
- /// Switch the block in the player's hand
- ///
- /// The block to switch to.
- /// The player. Omit this to use the local player.
- public static void EquipBlock(BlockIDs block, uint playerID = uint.MaxValue)
- {
- if (playerID == uint.MaxValue)
- {
- playerID = hotbarEngine.GetLocalPlayerID();
- }
- hotbarEngine.SelectBlock((int) block, playerID);
- // cubeSelectedByPick = true will crash the game
- // (this would be equivalent to mouse middle click pick block action)
- // reason: the game expects a Dictionary entry for the tweaked stats
- }
-
- ///
- /// Gets the block in the player's hand
- ///
- /// The equipped block.
- public static BlockIDs GetEquippedBlock()
- {
- return HotbarSlotSelectionHandlerEnginePatch.EquippedPartID;
- }
-
- public static void Init()
- {
- GameEngineManager.AddGameEngine(hotbarEngine);
- }
- }
-}
diff --git a/GamecraftModdingAPI/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs
deleted file mode 100644
index 34cdf12..0000000
--- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-
-using RobocraftX.Character;
-using RobocraftX.GUI.Hotbar;
-using RobocraftX.Players;
-using RobocraftX.Common;
-using RobocraftX.Common.Input;
-using RobocraftX.Common.Players;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Blocks;
-using GamecraftModdingAPI.Utility;
-using GamecraftModdingAPI.Engines;
-
-namespace GamecraftModdingAPI.Inventory
-{
- public class HotbarEngine : IApiEngine
- {
- public string Name { get; } = "GamecraftModdingAPIHotbarGameEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public bool IsInGame = false;
-
- public void Dispose()
- {
- IsInGame = false;
- }
-
- public void Ready()
- {
- IsInGame = true;
- }
-
- public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false)
- {
- var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToBuffer();
- if (inputs.count == 0) return false;
- for (int i = 0; i < inputs.count; i++)
- {
- if (inputs.buffer[i].ID.entityID == playerID) {
- inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick;
- inputs.buffer[i].selectedCube = block;
- return true;
- }
- }
- // TODO: expose the rest of the input functionality
- return false;
- }
-
- public uint GetLocalPlayerID()
- {
- return LocalPlayerIDUtility.GetLocalPlayerID(entitiesDB);
- }
- }
-}
diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs
deleted file mode 100644
index 14892a3..0000000
--- a/GamecraftModdingAPI/Player.cs
+++ /dev/null
@@ -1,446 +0,0 @@
-using System;
-using Gamecraft.GUI.Blueprints;
-using Unity.Mathematics;
-using RobocraftX.Common;
-using RobocraftX.Common.Players;
-using Svelto.ECS;
-
-using GamecraftModdingAPI.Players;
-using GamecraftModdingAPI.Blocks;
-
-namespace GamecraftModdingAPI
-{
- ///
- /// An in-game player character. Any Leo you see is a player.
- ///
- public class Player : IEquatable, IEquatable
- {
- // static functionality
- private static PlayerEngine playerEngine = new PlayerEngine();
- private static Player localPlayer;
-
- ///
- /// Checks if the specified player exists.
- ///
- /// Whether the player exists.
- /// Player type.
- public static bool Exists(PlayerType player)
- {
- switch (player)
- {
- case PlayerType.Remote:
- return playerEngine.GetRemotePlayer() != uint.MaxValue;
- case PlayerType.Local:
- return playerEngine.GetLocalPlayer() != uint.MaxValue;
- }
- return false;
- }
-
- ///
- /// Checks if the specified player exists.
- ///
- /// Whether the player exists.
- /// The player's unique identifier.
- public static bool Exists(uint player)
- {
- return playerEngine.ExistsById(player);
- }
-
- ///
- /// The amount of Players in the current game.
- ///
- /// The count.
- public static uint Count()
- {
- return (uint) playerEngine.GetAllPlayerCount();
- }
-
- ///
- /// Returns the current player belonging to this client.
- ///
- public static Player LocalPlayer
- {
- get
- {
- if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer())
- localPlayer = new Player(PlayerType.Local);
- return localPlayer;
- }
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The player's unique identifier.
- public Player(uint id)
- {
- this.Id = id;
- if (!Exists(id))
- {
- throw new PlayerNotFoundException($"No player with id {id} exists");
- }
- this.Type = playerEngine.GetLocalPlayer() == id ? PlayerType.Local : PlayerType.Remote;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// The player type. Chooses the first available player matching the criteria.
- public Player(PlayerType player)
- {
- switch (player)
- {
- case PlayerType.Local:
- this.Id = playerEngine.GetLocalPlayer();
- break;
- case PlayerType.Remote:
- this.Id = playerEngine.GetRemotePlayer();
- break;
- }
- if (this.Id == uint.MaxValue)
- {
- throw new PlayerNotFoundException($"No player of {player} type exists");
- }
- this.Type = player;
- }
-
- // object fields & properties
-
- ///
- /// The player's type.
- /// The player type is always relative to the current client, not the game host.
- ///
- /// The enumerated player type.
- public PlayerType Type { get; }
-
- ///
- /// The player's unique identifier.
- ///
- /// The identifier.
- public uint Id { get; }
-
- ///
- /// The player's current position.
- ///
- /// The position.
- public float3 Position
- {
- get
- {
- return playerEngine.GetLocation(Id);
- }
-
- set
- {
- playerEngine.SetLocation(Id, value, false);
- }
- }
-
- ///
- /// The player's current rotation.
- ///
- /// The rotation.
- public float3 Rotation
- {
- get
- {
- return playerEngine.GetRotation(Id);
- }
-
- set
- {
- playerEngine.SetRotation(Id, value);
- }
- }
-
- ///
- /// The player's current velocity.
- ///
- /// The velocity.
- public float3 Velocity
- {
- get
- {
- return playerEngine.GetLinearVelocity(Id);
- }
-
- set
- {
- playerEngine.SetLinearVelocity(Id, value);
- }
- }
-
- ///
- /// The player's current angular velocity.
- ///
- /// The angular velocity.
- public float3 AngularVelocity
- {
- get
- {
- return playerEngine.GetAngularVelocity(Id);
- }
-
- set
- {
- playerEngine.SetAngularVelocity(Id, value);
- }
- }
-
- ///
- /// The player's mass.
- ///
- /// The mass.
- public float Mass
- {
- get
- {
- return 1f / playerEngine.GetMass(Id).InverseMass;
- }
-
- // FIXME: Setting mass doesn't do anything
- /*set
- {
- playerEngine.SetInverseMass(Id, 1f / value);
- }*/
- }
-
- private float _ping = -1f;
-
- ///
- /// The player's latest network ping time.
- ///
- /// The ping (s).
- public float Ping
- {
- get
- {
- float? temp = playerEngine.GetLastPingTime(Id, Type);
- if (temp.HasValue)
- {
- _ping = temp.Value;
- }
- return _ping;
- }
- }
-
- ///
- /// The player's initial health when entering Simulation (aka Time Running) mode.
- ///
- /// The initial health.
- public float InitialHealth
- {
- get => playerEngine.GetInitialHealth(Id);
-
- set
- {
- playerEngine.SetInitialHealth(Id, value);
- }
- }
-
- ///
- /// The player's current health in Simulation (aka Time Running) mode.
- ///
- /// The current health.
- public float CurrentHealth
- {
- get => playerEngine.GetCurrentHealth(Id);
-
- set
- {
- playerEngine.DamagePlayer(Id, CurrentHealth - value);
- }
- }
-
- ///
- /// Whether this is damageable.
- ///
- /// true if damageable; otherwise, false.
- public bool Damageable
- {
- get => playerEngine.GetDamageable(Id);
-
- set
- {
- playerEngine.SetDamageable(Id, value);
- }
- }
-
- ///
- /// The player's lives when initially entering Simulation (aka Time Running) mode.
- ///
- /// The initial lives.
- public uint InitialLives
- {
- get => playerEngine.GetInitialLives(Id);
-
- set => playerEngine.SetInitialLives(Id, value);
- }
-
- ///
- /// The player's current lives in Simulation (aka Time Running) mode.
- ///
- /// The current lives.
- public uint CurrentLives
- {
- get => playerEngine.GetCurrentLives(Id);
-
- set => playerEngine.SetCurrentLives(Id, value);
- }
-
- ///
- /// Whether the Game Over screen is displayed for the player.
- ///
- /// true if game over; otherwise, false.
- public bool GameOver
- {
- get => playerEngine.GetGameOverScreen(Id);
- }
-
- ///
- /// Whether the player is dead.
- /// If true, hopefully it was quick.
- ///
- /// true if dead; otherwise, false.
- public bool Dead
- {
- get => playerEngine.IsDead(Id);
- }
-
- ///
- /// The player's selected block ID in their hand.
- ///
- /// The selected block.
- public BlockIDs SelectedBlock
- {
- get
- {
- return (BlockIDs)playerEngine.GetSelectedBlock(Id);
- }
- }
-
- ///
- /// The player's selected block color in their hand.
- ///
- /// The selected block's color.
- public BlockColor SelectedColor
- {
- get
- {
- return new BlockColor(playerEngine.GetSelectedColor(Id));
- }
- }
-
- ///
- /// The player's selected block colour in their hand.
- ///
- /// The selected block's colour.
- public BlockColor SelectedColour
- {
- get
- {
- return new BlockColor(playerEngine.GetSelectedColor(Id));
- }
- }
-
- ///
- /// The player's selected blueprint in their hand. Set to null to clear. Dispose after usage.
- ///
- public Blueprint SelectedBlueprint
- {
- get => playerEngine.GetPlayerStruct(Id, out BlueprintInventoryItemEntityStruct biies)
- ? new Blueprint(biies.blueprintResourceId)
- : null;
- set => BlockGroup._engine.SelectBlueprint(value?.Id ?? uint.MaxValue);
- }
-
- // object methods
-
- ///
- /// Teleport the player to the specified coordinates.
- ///
- /// The x coordinate.
- /// The y coordinate.
- /// The z coordinate.
- /// If set to true teleport relative to the player's current position.
- /// If set to true exit any seat the player is in.
- public void Teleport(float x, float y, float z, bool relative = true, bool exitSeat = true)
- {
- float3 location = new float3(x, y, z);
- if (relative)
- {
- location += playerEngine.GetLocation(Id);
- }
- playerEngine.SetLocation(Id, location, exitSeat: exitSeat);
- }
-
- ///
- /// Returns the block the player is currently looking at in build mode.
- ///
- /// The maximum distance from the player (default is the player's building reach)
- /// The block or null if not found
- public Block GetBlockLookedAt(float maxDistance = -1f)
- {
- var egid = playerEngine.GetThingLookedAt(Id, maxDistance);
- return egid.HasValue && egid.Value.groupID != CommonExclusiveGroups.SIMULATION_BODIES_GROUP
- ? new Block(egid.Value)
- : null;
- }
-
- ///
- /// Returns the rigid body the player is currently looking at during simulation.
- ///
- /// The maximum distance from the player (default is the player's building reach)
- /// The block or null if not found
- public SimBody GetSimBodyLookedAt(float maxDistance = -1f)
- {
- var egid = playerEngine.GetThingLookedAt(Id, maxDistance);
- return egid.HasValue && egid.Value.groupID == CommonExclusiveGroups.SIMULATION_BODIES_GROUP
- ? new SimBody(egid.Value)
- : null;
- }
-
- ///
- /// Returns the blocks that are in the player's current selection.
- ///
- /// An array of blocks or an empty array
- public Block[] GetSelectedBlocks()
- {
- return playerEngine.GetSelectedBlocks(Id);
- }
-
- public bool Equals(Player other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return Id == other.Id;
- }
-
- public bool Equals(EGID other)
- {
- return Id == other.entityID && other.groupID == (Type == PlayerType.Local
- ? PlayersExclusiveGroups.LocalPlayers
- : PlayersExclusiveGroups.RemotePlayers);
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((Player) obj);
- }
-
- public override int GetHashCode()
- {
- return (int) Id;
- }
-
- // internal methods
-
- internal static void Init()
- {
- Utility.GameEngineManager.AddGameEngine(playerEngine);
- }
- }
-}
diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs
deleted file mode 100644
index e253eac..0000000
--- a/GamecraftModdingAPI/Players/PlayerEngine.cs
+++ /dev/null
@@ -1,479 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-using RobocraftX.Character;
-using RobocraftX.Character.Movement;
-using RobocraftX.Common.Players;
-using RobocraftX.Common.Input;
-using RobocraftX.CR.MachineEditing.BoxSelect;
-using RobocraftX.Physics;
-using RobocraftX.Blocks.Ghost;
-using RobocraftX.Character.Camera;
-using RobocraftX.Character.Factories;
-using Gamecraft.GUI.HUDFeedbackBlocks;
-using Svelto.ECS;
-using Unity.Mathematics;
-using Unity.Physics;
-using UnityEngine;
-
-using GamecraftModdingAPI.Engines;
-using HarmonyLib;
-using RobocraftX.Common;
-using Svelto.ECS.DataStructures;
-
-namespace GamecraftModdingAPI.Players
-{
- internal class PlayerEngine : IApiEngine, IFactoryEngine
- {
- public string Name { get; } = "GamecraftModdingAPIPlayerGameEngine";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => false;
-
- public IEntityFactory Factory { set; private get; }
-
- private bool isReady = false;
-
- public void Dispose()
- {
- isReady = false;
- }
-
- public void Ready()
- {
- isReady = true;
- }
-
- public uint GetLocalPlayer()
- {
- if (!isReady) return uint.MaxValue;
- var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToBuffer();
- if (localPlayers.count > 0)
- {
- return localPlayers.buffer[0].ID.entityID;
- }
- return uint.MaxValue;
- }
-
- public uint GetRemotePlayer()
- {
- if (!isReady) return uint.MaxValue;
- var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToBuffer();
- if (localPlayers.count > 0)
- {
- return localPlayers.buffer[0].ID.entityID;
- }
- return uint.MaxValue;
- }
-
- public long GetAllPlayerCount()
- {
- if (entitiesDB == null) return 0;
- long count = 0;
- foreach (ExclusiveGroupStruct eg in PlayersExclusiveGroups.AllPlayers)
- {
- count += entitiesDB.Count(eg);
- }
- return count;
- }
-
- public long GetLocalPlayerCount()
- {
- if (entitiesDB == null) return 0;
- return entitiesDB.Count(PlayersExclusiveGroups.LocalPlayers);
- }
-
- public long GetRemotePlayerCount()
- {
- if (entitiesDB == null) return 0;
- return entitiesDB.Count(PlayersExclusiveGroups.RemotePlayers);
- }
-
- public bool ExistsById(uint playerId)
- {
- if (entitiesDB == null) return false;
- return entitiesDB.Exists(playerId, PlayersExclusiveGroups.LocalPlayers)
- || entitiesDB.Exists(playerId, PlayersExclusiveGroups.RemotePlayers);
- }
-
- public float3 GetLocation(uint playerId)
- {
- if (entitiesDB == null) return float3.zero;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return rbes.position;
- }
- return float3.zero;
- }
-
- public bool SetLocation(uint playerId, float3 location, bool exitSeat = true)
- {
- if (entitiesDB == null) return false;
- var characterGroups = CharacterExclusiveGroups.AllCharacters;
- for (int i = 0; i < characterGroups.count; i++)
- {
- EGID egid = new EGID(playerId, characterGroups[i]);
- if (entitiesDB.Exists(egid))
- {
- ref RigidBodyEntityStruct rbes = ref entitiesDB.QueryEntity(egid);
- if (characterGroups[i] == CharacterExclusiveGroups.InPilotSeatGroup && exitSeat)
- {
- entitiesDB.QueryEntity(egid).instantExit = true;
- entitiesDB.PublishEntityChange(egid);
- }
- rbes.position = location;
- return true;
- }
- }
- return false;
- }
-
- public float3 GetRotation(uint playerId)
- {
- if (entitiesDB == null) return float3.zero;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return ((Quaternion) rbes.rotation).eulerAngles;
- }
- return default(float3);
- }
-
- public bool SetRotation(uint playerId, float3 value)
- {
- if (entitiesDB == null) return false;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- Quaternion q = rbes.rotation;
- q.eulerAngles = value;
- rbes.rotation = q;
- return true;
- }
- return false;
- }
-
- public float3 GetLinearVelocity(uint playerId)
- {
- if (entitiesDB == null) return float3.zero;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return rbes.velocity;
- }
- return float3.zero;
- }
-
- public bool SetLinearVelocity(uint playerId, float3 value)
- {
- if (entitiesDB == null) return false;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- rbes.velocity = value;
- return true;
- }
- return false;
- }
-
- public float3 GetAngularVelocity(uint playerId)
- {
- if (entitiesDB == null) return float3.zero;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return rbes.angularVelocity;
- }
- return float3.zero;
- }
-
- public bool SetAngularVelocity(uint playerId, float3 value)
- {
- if (entitiesDB == null) return false;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- rbes.angularVelocity = value;
- return true;
- }
- return false;
- }
-
- public PhysicsMass GetMass(uint playerId)
- {
- if (entitiesDB == null) return default(PhysicsMass);
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return rbes.physicsMass;
- }
- return default(PhysicsMass);
- }
-
- public bool SetInverseMass(uint playerId, float inverseMass)
- {
- if (entitiesDB == null) return false;
- ref var rbes = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- rbes.physicsMass.InverseInertia = inverseMass;
- return true;
- }
- return false;
- }
-
- public float? GetLastPingTime(uint playerId, PlayerType type)
- {
- if (entitiesDB == null) return null;
- EGID egid = new EGID(playerId, PlayerGroupFromEnum(type));
- if (entitiesDB.Exists(egid))
- {
- return entitiesDB.QueryEntity(egid).lastPingTimeSinceLevelLoad;
- }
- return null;
- }
-
- public float GetInitialHealth(uint playerId)
- {
- if (entitiesDB == null) return 0;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return c.initialHealth;
- }
- return -1f;
- }
-
- public bool SetInitialHealth(uint playerId, float val)
- {
- if (entitiesDB == null) return false;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- c.initialHealth = val;
- return true;
- }
- return false;
- }
-
- public float GetCurrentHealth(uint playerId)
- {
- if (entitiesDB == null) return 0;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return c.currentHealth;
- }
- return -1f;
- }
-
- public bool SetCurrentHealth(uint playerId, float val)
- {
- if (entitiesDB == null) return false;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- c.currentHealth = val;
- return true;
- }
- return false;
- }
-
- public bool DamagePlayer(uint playerId, float amount)
- {
- if (entitiesDB == null) return false;
- return SetCurrentHealth(playerId, GetCurrentHealth(playerId) - amount);
- }
-
- public bool GetDamageable(uint playerId)
- {
- if (entitiesDB == null) return false;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return c.canTakeDamageStat;
- }
- return false;
- }
-
- public bool SetDamageable(uint playerId, bool val)
- {
- if (entitiesDB == null) return false;
- ref var ches = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- ches.canTakeDamage = val;
- ches.canTakeDamage = val;
- return true;
- }
- return false;
- }
-
- public uint GetInitialLives(uint playerId)
- {
- if (entitiesDB == null) return 0;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return c.initialLives;
- }
- return uint.MaxValue;
- }
-
- public bool SetInitialLives(uint playerId, uint val)
- {
- if (entitiesDB == null) return false;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- c.initialLives = val;
- return true;
- }
- return false;
- }
-
- public uint GetCurrentLives(uint playerId)
- {
- if (entitiesDB == null) return 0;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- return c.currentLives;
- }
- return uint.MaxValue;
- }
-
- public bool SetCurrentLives(uint playerId, uint val)
- {
- if (entitiesDB == null) return false;
- ref var c = ref GetCharacterStruct(playerId, out bool exists);
- if (exists)
- {
- c.currentLives = val;
- return true;
- }
- return false;
- }
-
- public bool GetGameOverScreen(uint playerId)
- {
- if (entitiesDB == null) return false;
- ref HudActivatedBlocksEntityStruct habes = ref entitiesDB.QueryEntity(HUDFeedbackBlocksGUIExclusiveGroups.GameOverHudEgid);
- NativeDynamicArrayCast nativeDynamicArrayCast = new NativeDynamicArrayCast(habes.activatedBlocksOrdered);
- return nativeDynamicArrayCast.count > 0;
- }
-
- public bool IsDead(uint playerId)
- {
- if (entitiesDB == null) return true;
- return entitiesDB.Exists