From 1cb663b4d13b60565661f553221446ab2d026f95 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 9 Nov 2020 16:18:25 -0500 Subject: [PATCH] Fix build errors from beta hotfix 1 --- GamecraftModdingAPI/App/AppEngine.cs | 5 +- GamecraftModdingAPI/App/GameGameEngine.cs | 6 +- GamecraftModdingAPI/App/GameMenuEngine.cs | 10 +- GamecraftModdingAPI/Block.cs | 42 +- GamecraftModdingAPI/Blocks/BlockEngine.cs | 49 ++- GamecraftModdingAPI/Blocks/BlockEngineInit.cs | 4 +- GamecraftModdingAPI/Blocks/ConsoleBlock.cs | 2 +- GamecraftModdingAPI/Blocks/DampedSpring.cs | 2 +- GamecraftModdingAPI/Blocks/LogicGate.cs | 2 +- GamecraftModdingAPI/Blocks/Motor.cs | 2 +- GamecraftModdingAPI/Blocks/MusicBlock.cs | 2 +- .../Blocks/ObjectIdentifier.cs | 2 +- GamecraftModdingAPI/Blocks/Piston.cs | 2 +- GamecraftModdingAPI/Blocks/PlacementEngine.cs | 3 +- GamecraftModdingAPI/Blocks/Servo.cs | 2 +- GamecraftModdingAPI/Blocks/SfxBlock.cs | 2 +- GamecraftModdingAPI/Blocks/SignalEngine.cs | 44 +- GamecraftModdingAPI/Blocks/SpawnPoint.cs | 2 +- GamecraftModdingAPI/Blocks/TextBlock.cs | 2 +- GamecraftModdingAPI/Blocks/Timer.cs | 2 +- .../GamecraftModdingAPI.csproj | 413 +++++++++--------- GamecraftModdingAPI/Inventory/HotbarEngine.cs | 8 +- GamecraftModdingAPI/Players/PlayerEngine.cs | 8 +- GamecraftModdingAPI/Tests/TestRoot.cs | 2 +- 24 files changed, 330 insertions(+), 288 deletions(-) diff --git a/GamecraftModdingAPI/App/AppEngine.cs b/GamecraftModdingAPI/App/AppEngine.cs index 4f20b7e..9cc454d 100644 --- a/GamecraftModdingAPI/App/AppEngine.cs +++ b/GamecraftModdingAPI/App/AppEngine.cs @@ -46,11 +46,12 @@ namespace GamecraftModdingAPI.App 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 {mgsevs[i].GameName}"); - games[i] = new Game(mgsevs[i].ID); + Utility.Logging.MetaDebugLog($"Found game named {mgsevsB[i].GameName}"); + games[i] = new Game(mgsevsB[i].ID); } return games; } diff --git a/GamecraftModdingAPI/App/GameGameEngine.cs b/GamecraftModdingAPI/App/GameGameEngine.cs index a616df5..dea3821 100644 --- a/GamecraftModdingAPI/App/GameGameEngine.cs +++ b/GamecraftModdingAPI/App/GameGameEngine.cs @@ -52,7 +52,7 @@ namespace GamecraftModdingAPI.App { if (async) { - ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); + ExitCurrentGameAsync().RunOn(Lean.EveryFrameStepRunner_TimeRunningAndStopped); } else { @@ -102,14 +102,14 @@ namespace GamecraftModdingAPI.App if (filter == BlockIDs.Invalid) { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); } else { foreach (var (blocks, _) in allBlocks) - foreach (var block in blocks) + foreach (var block in blocks.ToBuffer().buffer.ToManagedArray()) if (block.DBID == (ulong) filter) blockEGIDs.Add(block.ID); return blockEGIDs.ToArray(); diff --git a/GamecraftModdingAPI/App/GameMenuEngine.cs b/GamecraftModdingAPI/App/GameMenuEngine.cs index 74bc42a..efcb73e 100644 --- a/GamecraftModdingAPI/App/GameMenuEngine.cs +++ b/GamecraftModdingAPI/App/GameMenuEngine.cs @@ -61,12 +61,13 @@ namespace GamecraftModdingAPI.App 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 (games[i].ID.entityID > max) + if (gamesB[i].ID.entityID > max) { - max = games[i].ID.entityID; + max = gamesB[i].ID.entityID; } } return max; @@ -118,11 +119,12 @@ namespace GamecraftModdingAPI.App { EntityCollection entities = entitiesDB.QueryEntities(MyGamesScreenExclusiveGroups.GameSlotGuiEntities); + var entitiesB = entities.ToBuffer().buffer; for (int i = 0; i < entities.count; i++) { - if (entities[i].ID.entityID == id.entityID) + if (entitiesB[i].ID.entityID == id.entityID) { - return ref entities[i]; + return ref entitiesB[i]; } } MyGamesSlotEntityViewStruct[] defRef = new MyGamesSlotEntityViewStruct[1]; diff --git a/GamecraftModdingAPI/Block.cs b/GamecraftModdingAPI/Block.cs index 408304d..81d6439 100644 --- a/GamecraftModdingAPI/Block.cs +++ b/GamecraftModdingAPI/Block.cs @@ -116,32 +116,32 @@ namespace GamecraftModdingAPI private static Dictionary typeToGroup = new Dictionary { - {typeof(ConsoleBlock), new[] {CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP}}, - {typeof(LogicGate), new [] {CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP}}, - {typeof(Motor), new[] {CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP}}, - {typeof(MusicBlock), new[] {CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP}}, - {typeof(ObjectIdentifier), new[]{CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP}}, - {typeof(Piston), new[] {CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP}}, - {typeof(Servo), new[] {CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP}}, + {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.BUILD_SPAWNPOINT_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_BUILDINGSPAWN_BLOCK_GROUP + CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP, + CommonExclusiveGroups.BUILDINGSPAWN_BLOCK_GROUP } }, { typeof(SfxBlock), new[] { - CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP, - CommonExclusiveGroups.BUILD_LOOPEDSFX_BLOCK_GROUP + CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP, + CommonExclusiveGroups.LOOPEDSFX_BLOCK_GROUP } }, - {typeof(DampedSpring), new [] {CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP}}, - {typeof(TextBlock), new[] {CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP}}, - {typeof(Timer), new[] {CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP}} + {typeof(DampedSpring), new [] {CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP}}, + {typeof(TextBlock), new[] {CommonExclusiveGroups.TEXT_BLOCK_GROUP}}, + {typeof(Timer), new[] {CommonExclusiveGroups.TIMER_BLOCK_GROUP}} }; /// @@ -312,8 +312,9 @@ namespace GamecraftModdingAPI BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, BlockColor val) => { color.indexInPalette = (byte) (val.Color + val.Darkness * 10); - color.overridePaletteColour = false; - color.needsUpdate = true; + //color.overridePaletteColour = false; + //color.needsUpdate = true; + color.hasNetworkChange = true; color.paletteColour = BlockEngine.ConvertBlockColor(color.indexInPalette); }, value); } @@ -324,14 +325,15 @@ namespace GamecraftModdingAPI /// public float4 CustomColor { - get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.overriddenColour); + get => BlockEngine.GetBlockInfo(this, (ColourParameterEntityStruct st) => st.paletteColour); set { BlockEngine.SetBlockInfo(this, (ref ColourParameterEntityStruct color, float4 val) => { - color.overriddenColour = val; - color.overridePaletteColour = true; - color.needsUpdate = true; + color.paletteColour = val; + //color.overridePaletteColour = true; + //color.needsUpdate = true; + color.hasNetworkChange = true; }, value); } } diff --git a/GamecraftModdingAPI/Blocks/BlockEngine.cs b/GamecraftModdingAPI/Blocks/BlockEngine.cs index e39a3e8..5566525 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngine.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngine.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Gamecraft.ColourPalette; +using Gamecraft.TimeRunning; using Gamecraft.Wires; using RobocraftX.Blocks; using RobocraftX.Common; @@ -43,8 +44,14 @@ namespace GamecraftModdingAPI.Blocks FasterList cubes = new FasterList(10); var coll = entitiesDB.QueryEntities(); foreach (var (ecoll, _) in coll) - foreach (ref var conn in ecoll) - conn.isProcessed = false; + { + 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; }); @@ -68,17 +75,17 @@ namespace GamecraftModdingAPI.Blocks return ref structHolder[0]; //Gets a default value automatically } - public ref T GetBlockInfoViewStruct(EGID blockID) where T : struct, INeedEGID, IEntityComponent + 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 - EntityCollection entities = entitiesDB.QueryEntities(blockID.groupID); + BT> entities = entitiesDB.QueryEntities(blockID.groupID).ToBuffer(); for (int i = 0; i < entities.count; i++) { - if (entities[i].ID == blockID) + if (entities.buffer[i].ID == blockID) { - return ref entities[i]; + return ref entities.buffer[i]; } } } @@ -160,12 +167,13 @@ namespace GamecraftModdingAPI.Blocks public SimBody[] GetSimBodiesFromID(byte id) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new SimBody[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - var connections = entitiesDB.QueryMappedEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + 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) @@ -182,21 +190,26 @@ namespace GamecraftModdingAPI.Blocks public ObjectIdentifier[] GetObjectIDsFromID(byte id, bool sim) { var ret = new FasterList(4); - if (!entitiesDB.HasAny(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + if (!entitiesDB.HasAny(CommonExclusiveGroups.OBJID_BLOCK_GROUP)) return new ObjectIdentifier[0]; - var oids = entitiesDB.QueryEntities(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP); - foreach (ref ObjectIdEntityStruct oid in oids) + 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); + var joints = entitiesDB.QueryEntities(MachineSimulationGroups.JOINTS_GROUP).ToBuffer(); var list = new FasterList(4); - foreach (var joint in joints) + 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)); @@ -211,7 +224,7 @@ namespace GamecraftModdingAPI.Blocks var bodies = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.clusterId == cid) bodies.Add(conn.machineRigidBodyId); @@ -238,7 +251,7 @@ namespace GamecraftModdingAPI.Blocks var groups = entitiesDB.QueryEntities(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { //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); @@ -254,7 +267,7 @@ namespace GamecraftModdingAPI.Blocks var set = new HashSet(); foreach (var (coll, _) in groups) { - foreach (var conn in coll) + foreach (var conn in coll.ToBuffer().buffer.ToManagedArray()) { if (conn.machineRigidBodyId == sbid) set.Add(new Block(conn.ID)); diff --git a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs index 70f713a..1bf6c15 100644 --- a/GamecraftModdingAPI/Blocks/BlockEngineInit.cs +++ b/GamecraftModdingAPI/Blocks/BlockEngineInit.cs @@ -14,10 +14,10 @@ namespace GamecraftModdingAPI.Blocks /// internal struct BlockInitData { - public FasterDictionary, ITypeSafeDictionary> Group; + public FasterDictionary Group; } - internal delegate FasterDictionary, ITypeSafeDictionary> GetInitGroup( + internal delegate FasterDictionary GetInitGroup( EntityComponentInitializer initializer); /// diff --git a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs index c8982e4..e696fca 100644 --- a/GamecraftModdingAPI/Blocks/ConsoleBlock.cs +++ b/GamecraftModdingAPI/Blocks/ConsoleBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_CONSOLE_BLOCK_GROUP)) + public ConsoleBlock(uint id): base(new EGID(id, CommonExclusiveGroups.CONSOLE_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/DampedSpring.cs b/GamecraftModdingAPI/Blocks/DampedSpring.cs index 96e628d..5a5a936 100644 --- a/GamecraftModdingAPI/Blocks/DampedSpring.cs +++ b/GamecraftModdingAPI/Blocks/DampedSpring.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_DAMPEDSPRING_BLOCK_GROUP)) + public DampedSpring(uint id) : base(new EGID(id, CommonExclusiveGroups.DAMPEDSPRING_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/LogicGate.cs b/GamecraftModdingAPI/Blocks/LogicGate.cs index 124bc10..2ec4cef 100644 --- a/GamecraftModdingAPI/Blocks/LogicGate.cs +++ b/GamecraftModdingAPI/Blocks/LogicGate.cs @@ -9,7 +9,7 @@ namespace GamecraftModdingAPI.Blocks { } - public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_LOGIC_BLOCK_GROUP)) + public LogicGate(uint id) : base(new EGID(id, CommonExclusiveGroups.LOGIC_BLOCK_GROUP)) { } } diff --git a/GamecraftModdingAPI/Blocks/Motor.cs b/GamecraftModdingAPI/Blocks/Motor.cs index 3c38a52..0a69d27 100644 --- a/GamecraftModdingAPI/Blocks/Motor.cs +++ b/GamecraftModdingAPI/Blocks/Motor.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.BUILD_MOTOR_BLOCK_GROUP)) + public Motor(uint id): base(new EGID(id, CommonExclusiveGroups.MOTOR_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/MusicBlock.cs b/GamecraftModdingAPI/Blocks/MusicBlock.cs index fc3c880..6b99b6f 100644 --- a/GamecraftModdingAPI/Blocks/MusicBlock.cs +++ b/GamecraftModdingAPI/Blocks/MusicBlock.cs @@ -20,7 +20,7 @@ namespace GamecraftModdingAPI.Blocks { } - public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_MUSIC_BLOCK_GROUP)) + public MusicBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.MUSIC_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs index 0dc835a..1233343 100644 --- a/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs +++ b/GamecraftModdingAPI/Blocks/ObjectIdentifier.cs @@ -10,7 +10,7 @@ namespace GamecraftModdingAPI.Blocks { } - public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP)) + public ObjectIdentifier(uint id) : base(new EGID(id, CommonExclusiveGroups.OBJID_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Piston.cs b/GamecraftModdingAPI/Blocks/Piston.cs index c3f2497..04b3aeb 100644 --- a/GamecraftModdingAPI/Blocks/Piston.cs +++ b/GamecraftModdingAPI/Blocks/Piston.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_PISTON_BLOCK_GROUP)) + public Piston(uint id) : base(new EGID(id, CommonExclusiveGroups.PISTON_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/PlacementEngine.cs b/GamecraftModdingAPI/Blocks/PlacementEngine.cs index cb1cdee..cf9a80f 100644 --- a/GamecraftModdingAPI/Blocks/PlacementEngine.cs +++ b/GamecraftModdingAPI/Blocks/PlacementEngine.cs @@ -16,6 +16,7 @@ using UnityEngine; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Engines; using GamecraftModdingAPI.Players; +using RobocraftX.Rendering.GPUI; namespace GamecraftModdingAPI.Blocks { @@ -81,7 +82,7 @@ namespace GamecraftModdingAPI.Blocks structInitializer.Init(new ColourParameterEntityStruct { indexInPalette = colour.indexInPalette, - needsUpdate = true + hasNetworkChange = true }); uint prefabId = PrefabsID.GetPrefabId(dbid, 0); structInitializer.Init(new GFXPrefabEntityStructGPUI(prefabId)); diff --git a/GamecraftModdingAPI/Blocks/Servo.cs b/GamecraftModdingAPI/Blocks/Servo.cs index 1177fb6..606a48a 100644 --- a/GamecraftModdingAPI/Blocks/Servo.cs +++ b/GamecraftModdingAPI/Blocks/Servo.cs @@ -15,7 +15,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SERVO_BLOCK_GROUP)) + public Servo(uint id) : base(new EGID(id, CommonExclusiveGroups.SERVO_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/SfxBlock.cs b/GamecraftModdingAPI/Blocks/SfxBlock.cs index f7efe6d..88d69d2 100644 --- a/GamecraftModdingAPI/Blocks/SfxBlock.cs +++ b/GamecraftModdingAPI/Blocks/SfxBlock.cs @@ -14,7 +14,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) + public SfxBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.SIMPLESFX_BLOCK_GROUP /* This could also be BUILD_LOOPEDSFX_BLOCK_GROUP */)) { } diff --git a/GamecraftModdingAPI/Blocks/SignalEngine.cs b/GamecraftModdingAPI/Blocks/SignalEngine.cs index 763a1a1..0980d79 100644 --- a/GamecraftModdingAPI/Blocks/SignalEngine.cs +++ b/GamecraftModdingAPI/Blocks/SignalEngine.cs @@ -115,7 +115,8 @@ namespace GamecraftModdingAPI.Blocks public bool SetSignal(uint signalID, float signal, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - if (array.count > 0) array[index].valueAsFloat = signal; + var arrayB = array.ToBuffer(); + if (array.count > 0) arrayB.buffer[index].valueAsFloat = signal; return false; } @@ -128,9 +129,10 @@ namespace GamecraftModdingAPI.Blocks public float AddSignal(uint signalID, float signal, bool clamp = true, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); + var arrayB = array.ToBuffer(); if (array.count > 0) { - ref var channelData = ref array[index]; + ref var channelData = ref arrayB.buffer[index]; channelData.valueAsFloat += signal; if (clamp) { @@ -159,7 +161,8 @@ namespace GamecraftModdingAPI.Blocks public float GetSignal(uint signalID, bool input = true) { var array = GetSignalStruct(signalID, out uint index, input); - return array.count > 0 ? array[index].valueAsFloat : 0f; + var arrayB = array.ToBuffer(); + return array.count > 0 ? arrayB.buffer[index].valueAsFloat : 0f; } public uint[] GetSignalIDs(EGID blockID, bool input = true) @@ -244,13 +247,14 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (uint i = 0; i < wires.count; i++) { - if ((wires[i].destinationPortUsage == port.usage && wires[i].destinationBlockEGID == blockID) - || (wires[i].sourcePortUsage == port.usage && wires[i].sourceBlockEGID == blockID)) + if ((wiresB[i].destinationPortUsage == port.usage && wiresB[i].destinationBlockEGID == blockID) + || (wiresB[i].sourcePortUsage == port.usage && wiresB[i].sourceBlockEGID == blockID)) { exists = true; - return ref wires[i]; + return ref wiresB[i]; } } exists = false; @@ -286,6 +290,7 @@ namespace GamecraftModdingAPI.Blocks } EntityCollection wires = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var wiresB = wires.ToBuffer().buffer; for (int endIndex = 0; endIndex < endPorts.Length; endIndex++) { PortEntityStruct endPES = entitiesDB.QueryEntity(endPorts[endIndex]); @@ -294,11 +299,11 @@ namespace GamecraftModdingAPI.Blocks PortEntityStruct startPES = entitiesDB.QueryEntity(startPorts[startIndex]); for (int w = 0; w < wires.count; w++) { - if ((wires[w].destinationPortUsage == endPES.usage && wires[w].destinationBlockEGID == endBlock) - && (wires[w].sourcePortUsage == startPES.usage && wires[w].sourceBlockEGID == startBlock)) + if ((wiresB[w].destinationPortUsage == endPES.usage && wiresB[w].destinationBlockEGID == endBlock) + && (wiresB[w].sourcePortUsage == startPES.usage && wiresB[w].sourceBlockEGID == startBlock)) { exists = true; - return ref wires[w]; + return ref wiresB[w]; } } } @@ -313,10 +318,11 @@ namespace GamecraftModdingAPI.Blocks { ref PortEntityStruct port = ref entitiesDB.QueryEntity(portID); var channels = entitiesDB.QueryEntities(NamedExclusiveGroup.Group); + var channelsB = channels.ToBuffer(); if (port.firstChannelIndexCachedInSim < channels.count) { exists = true; - return ref channels[port.firstChannelIndexCachedInSim]; + return ref channelsB.buffer[port.firstChannelIndexCachedInSim]; } exists = false; ChannelDataStruct[] defRef = new ChannelDataStruct[1]; @@ -327,8 +333,15 @@ namespace GamecraftModdingAPI.Blocks { var res = new FasterList(); foreach (var (coll, _) in entitiesDB.QueryEntities()) - foreach (ref BlockPortsStruct s in coll) - res.Add(s.ID); + { + var collB = coll.ToBuffer(); + for (int i = 0; i < coll.count; i++) + { + ref BlockPortsStruct s = ref collB.buffer[i]; + res.Add(s.ID); + } + } + return res.ToArray(); } @@ -358,15 +371,16 @@ namespace GamecraftModdingAPI.Blocks return result; } - private T[] Search(ExclusiveGroup group, Func isMatch) where T : struct, IEntityComponent + private T[] Search(ExclusiveGroup group, Func isMatch) where T : unmanaged, IEntityComponent { FasterList results = new FasterList(); EntityCollection components = entitiesDB.QueryEntities(group); + var componentsB = components.ToBuffer(); for (uint i = 0; i < components.count; i++) { - if (isMatch(components[i])) + if (isMatch(componentsB.buffer[i])) { - results.Add(components[i]); + results.Add(componentsB.buffer[i]); } } return results.ToArray(); diff --git a/GamecraftModdingAPI/Blocks/SpawnPoint.cs b/GamecraftModdingAPI/Blocks/SpawnPoint.cs index 7616acb..17bffd9 100644 --- a/GamecraftModdingAPI/Blocks/SpawnPoint.cs +++ b/GamecraftModdingAPI/Blocks/SpawnPoint.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_SPAWNPOINT_BLOCK_GROUP)) + public SpawnPoint(uint id) : base(new EGID(id, CommonExclusiveGroups.SPAWNPOINT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/TextBlock.cs b/GamecraftModdingAPI/Blocks/TextBlock.cs index e696dda..6fa5487 100644 --- a/GamecraftModdingAPI/Blocks/TextBlock.cs +++ b/GamecraftModdingAPI/Blocks/TextBlock.cs @@ -16,7 +16,7 @@ namespace GamecraftModdingAPI.Blocks { } - public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TEXT_BLOCK_GROUP)) + public TextBlock(uint id) : base(new EGID(id, CommonExclusiveGroups.TEXT_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/Blocks/Timer.cs b/GamecraftModdingAPI/Blocks/Timer.cs index 1aeecd9..0bbd302 100644 --- a/GamecraftModdingAPI/Blocks/Timer.cs +++ b/GamecraftModdingAPI/Blocks/Timer.cs @@ -17,7 +17,7 @@ namespace GamecraftModdingAPI.Blocks { } - public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.BUILD_TIMER_BLOCK_GROUP)) + public Timer(uint id) : base(new EGID(id, CommonExclusiveGroups.TIMER_BLOCK_GROUP)) { } diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 59de2af..cdbb4d9 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -25,11 +25,16 @@ + - - ..\ref\GamecraftPreview_Data\Managed\Accessibility.dll - ..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll + + ..\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 @@ -83,14 +88,14 @@ ..\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.BlockCompositionRoot.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll @@ -135,6 +140,10 @@ ..\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 @@ -187,6 +196,10 @@ ..\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 @@ -243,66 +256,10 @@ ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll - - ..\ref\GamecraftPreview_Data\Managed\FullGame.dll - ..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll - - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll - - - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll - - ..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll - - - ..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll - ..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll - - - ..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll - ..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll - - - ..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll - - - ..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll - ..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll ..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll @@ -379,18 +336,6 @@ ..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll ..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll - - ..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll - ..\..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll - - - ..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - ..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll - - - ..\ref\GamecraftPreview_Data\Managed\JWT.dll - ..\..\ref\GamecraftPreview_Data\Managed\JWT.dll - ..\ref\GamecraftPreview_Data\Managed\LZ4.dll ..\..\ref\GamecraftPreview_Data\Managed\LZ4.dll @@ -407,18 +352,6 @@ ..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll ..\..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.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\RCX.ScreenshotTaker.dll ..\..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll @@ -467,6 +400,10 @@ ..\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 @@ -523,6 +460,10 @@ ..\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 @@ -579,6 +520,10 @@ ..\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 @@ -631,9 +576,13 @@ ..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll ..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll - - ..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll - ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.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 @@ -643,114 +592,6 @@ ..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll ..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.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.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.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.Hybrid.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.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\UltimateDecals.dll ..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll @@ -795,14 +636,138 @@ ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll - - ..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll - ..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.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 @@ -859,6 +824,10 @@ ..\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 @@ -911,6 +880,10 @@ ..\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 @@ -963,6 +936,10 @@ ..\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 @@ -971,6 +948,10 @@ ..\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 @@ -1027,6 +1008,10 @@ ..\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 @@ -1047,6 +1032,30 @@ ..\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/Inventory/HotbarEngine.cs b/GamecraftModdingAPI/Inventory/HotbarEngine.cs index d5eb2d8..34cdf12 100644 --- a/GamecraftModdingAPI/Inventory/HotbarEngine.cs +++ b/GamecraftModdingAPI/Inventory/HotbarEngine.cs @@ -36,13 +36,13 @@ namespace GamecraftModdingAPI.Inventory public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false) { - var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers); + var inputs = entitiesDB.QueryEntities(InputExclusiveGroups.LocalPlayers).ToBuffer(); if (inputs.count == 0) return false; for (int i = 0; i < inputs.count; i++) { - if (inputs[i].ID.entityID == playerID) { - inputs[i].cubeSelectedByPick = cubeSelectedByPick; - inputs[i].selectedCube = block; + if (inputs.buffer[i].ID.entityID == playerID) { + inputs.buffer[i].cubeSelectedByPick = cubeSelectedByPick; + inputs.buffer[i].selectedCube = block; return true; } } diff --git a/GamecraftModdingAPI/Players/PlayerEngine.cs b/GamecraftModdingAPI/Players/PlayerEngine.cs index 6d461f2..e253eac 100644 --- a/GamecraftModdingAPI/Players/PlayerEngine.cs +++ b/GamecraftModdingAPI/Players/PlayerEngine.cs @@ -50,10 +50,10 @@ namespace GamecraftModdingAPI.Players public uint GetLocalPlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.LocalPlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } @@ -61,10 +61,10 @@ namespace GamecraftModdingAPI.Players public uint GetRemotePlayer() { if (!isReady) return uint.MaxValue; - var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers); + var localPlayers = entitiesDB.QueryEntities(PlayersExclusiveGroups.RemotePlayers).ToBuffer(); if (localPlayers.count > 0) { - return localPlayers[0].ID.entityID; + return localPlayers.buffer[0].ID.entityID; } return uint.MaxValue; } diff --git a/GamecraftModdingAPI/Tests/TestRoot.cs b/GamecraftModdingAPI/Tests/TestRoot.cs index 6acb51c..22f3035 100644 --- a/GamecraftModdingAPI/Tests/TestRoot.cs +++ b/GamecraftModdingAPI/Tests/TestRoot.cs @@ -65,7 +65,7 @@ namespace GamecraftModdingAPI.Tests _testsCountPassed = 0; _testsCountFailed = 0; // flow control - Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_RUNS_IN_TIME_STOPPED_AND_RUNNING); }; + Game.Enter += (sender, args) => { GameTests().RunOn(RobocraftX.Schedulers.Lean.EveryFrameStepRunner_TimeRunningAndStopped); }; Game.Exit += (s, a) => state = "ReturningFromGame"; Client.EnterMenu += (sender, args) => {