Browse Source

Fix build errors from beta hotfix 1

tags/v2.2.0
NGnius (Graham) 4 years ago
parent
commit
1cb663b4d1
24 changed files with 272 additions and 230 deletions
  1. +3
    -2
      GamecraftModdingAPI/App/AppEngine.cs
  2. +3
    -3
      GamecraftModdingAPI/App/GameGameEngine.cs
  3. +6
    -4
      GamecraftModdingAPI/App/GameMenuEngine.cs
  4. +22
    -20
      GamecraftModdingAPI/Block.cs
  5. +31
    -18
      GamecraftModdingAPI/Blocks/BlockEngine.cs
  6. +2
    -2
      GamecraftModdingAPI/Blocks/BlockEngineInit.cs
  7. +1
    -1
      GamecraftModdingAPI/Blocks/ConsoleBlock.cs
  8. +1
    -1
      GamecraftModdingAPI/Blocks/DampedSpring.cs
  9. +1
    -1
      GamecraftModdingAPI/Blocks/LogicGate.cs
  10. +1
    -1
      GamecraftModdingAPI/Blocks/Motor.cs
  11. +1
    -1
      GamecraftModdingAPI/Blocks/MusicBlock.cs
  12. +1
    -1
      GamecraftModdingAPI/Blocks/ObjectIdentifier.cs
  13. +1
    -1
      GamecraftModdingAPI/Blocks/Piston.cs
  14. +2
    -1
      GamecraftModdingAPI/Blocks/PlacementEngine.cs
  15. +1
    -1
      GamecraftModdingAPI/Blocks/Servo.cs
  16. +1
    -1
      GamecraftModdingAPI/Blocks/SfxBlock.cs
  17. +29
    -15
      GamecraftModdingAPI/Blocks/SignalEngine.cs
  18. +1
    -1
      GamecraftModdingAPI/Blocks/SpawnPoint.cs
  19. +1
    -1
      GamecraftModdingAPI/Blocks/TextBlock.cs
  20. +1
    -1
      GamecraftModdingAPI/Blocks/Timer.cs
  21. +153
    -144
      GamecraftModdingAPI/GamecraftModdingAPI.csproj
  22. +4
    -4
      GamecraftModdingAPI/Inventory/HotbarEngine.cs
  23. +4
    -4
      GamecraftModdingAPI/Players/PlayerEngine.cs
  24. +1
    -1
      GamecraftModdingAPI/Tests/TestRoot.cs

+ 3
- 2
GamecraftModdingAPI/App/AppEngine.cs View File

@@ -46,11 +46,12 @@ namespace GamecraftModdingAPI.App
public Game[] GetMyGames()
{
EntityCollection<MyGameDataEntityStruct> mgsevs = entitiesDB.QueryEntities<MyGameDataEntityStruct>(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;
}


+ 3
- 3
GamecraftModdingAPI/App/GameGameEngine.cs View File

@@ -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();


+ 6
- 4
GamecraftModdingAPI/App/GameMenuEngine.cs View File

@@ -61,12 +61,13 @@ namespace GamecraftModdingAPI.App
public uint HighestID()
{
EntityCollection<MyGameDataEntityStruct> games = entitiesDB.QueryEntities<MyGameDataEntityStruct>(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<MyGamesSlotEntityViewStruct> entities =
entitiesDB.QueryEntities<MyGamesSlotEntityViewStruct>(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];


+ 22
- 20
GamecraftModdingAPI/Block.cs View File

@@ -116,32 +116,32 @@ namespace GamecraftModdingAPI
private static Dictionary<Type, ExclusiveGroupStruct[]> typeToGroup =
new Dictionary<Type, ExclusiveGroupStruct[]>
{
{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}}
};

/// <summary>
@@ -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
/// </summary>
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);
}
}


+ 31
- 18
GamecraftModdingAPI/Blocks/BlockEngine.cs View File

@@ -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<EGID> cubes = new FasterList<EGID>(10);
var coll = entitiesDB.QueryEntities<GridConnectionsEntityStruct>();
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<T>(EGID blockID) where T : struct, INeedEGID, IEntityComponent
public ref T GetBlockInfoViewStruct<T>(EGID blockID) where T : struct, INeedEGID, IEntityViewComponent
{
if (entitiesDB.Exists<T>(blockID))
{
// TODO: optimize by using EntitiesDB internal calls instead of iterating over everything
EntityCollection<T> entities = entitiesDB.QueryEntities<T>(blockID.groupID);
BT<MB<T>> entities = entitiesDB.QueryEntities<T>(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<SimBody>(4);
if (!entitiesDB.HasAny<ObjectIdEntityStruct>(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP))
if (!entitiesDB.HasAny<ObjectIdEntityStruct>(CommonExclusiveGroups.OBJID_BLOCK_GROUP))
return new SimBody[0];
var oids = entitiesDB.QueryEntities<ObjectIdEntityStruct>(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP);
var connections = entitiesDB.QueryMappedEntities<GridConnectionsEntityStruct>(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP);
foreach (ref ObjectIdEntityStruct oid in oids)
var oids = entitiesDB.QueryEntities<ObjectIdEntityStruct>(CommonExclusiveGroups.OBJID_BLOCK_GROUP).ToBuffer();
var connections = entitiesDB.QueryMappedEntities<GridConnectionsEntityStruct>(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<ObjectIdentifier>(4);
if (!entitiesDB.HasAny<ObjectIdEntityStruct>(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP))
if (!entitiesDB.HasAny<ObjectIdEntityStruct>(CommonExclusiveGroups.OBJID_BLOCK_GROUP))
return new ObjectIdentifier[0];
var oids = entitiesDB.QueryEntities<ObjectIdEntityStruct>(CommonExclusiveGroups.BUILD_OBJID_BLOCK_GROUP);
foreach (ref ObjectIdEntityStruct oid in oids)
var oids = entitiesDB.QueryEntities<ObjectIdEntityStruct>(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<JointEntityStruct>(MachineSimulationGroups.JOINTS_GROUP);
var joints = entitiesDB.QueryEntities<JointEntityStruct>(MachineSimulationGroups.JOINTS_GROUP).ToBuffer();
var list = new FasterList<SimBody>(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<uint>();
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<GridConnectionsEntityStruct>();
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<Block>();
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));


+ 2
- 2
GamecraftModdingAPI/Blocks/BlockEngineInit.cs View File

@@ -14,10 +14,10 @@ namespace GamecraftModdingAPI.Blocks
/// </summary>
internal struct BlockInitData
{
public FasterDictionary<RefWrapper<Type>, ITypeSafeDictionary> Group;
public FasterDictionary<RefWrapperType, ITypeSafeDictionary> Group;
}

internal delegate FasterDictionary<RefWrapper<Type>, ITypeSafeDictionary> GetInitGroup(
internal delegate FasterDictionary<RefWrapperType, ITypeSafeDictionary> GetInitGroup(
EntityComponentInitializer initializer);

/// <summary>


+ 1
- 1
GamecraftModdingAPI/Blocks/ConsoleBlock.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/DampedSpring.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/LogicGate.cs View File

@@ -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))
{
}
}

+ 1
- 1
GamecraftModdingAPI/Blocks/Motor.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/MusicBlock.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/ObjectIdentifier.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/Piston.cs View File

@@ -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))
{
}



+ 2
- 1
GamecraftModdingAPI/Blocks/PlacementEngine.cs View File

@@ -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));


+ 1
- 1
GamecraftModdingAPI/Blocks/Servo.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/SfxBlock.cs View File

@@ -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 */))
{
}



+ 29
- 15
GamecraftModdingAPI/Blocks/SignalEngine.cs View File

@@ -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<PortEntityStruct>(portID);
var wires = entitiesDB.QueryEntities<WireEntityStruct>(NamedExclusiveGroup<WiresGroup>.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<WireEntityStruct> wires = entitiesDB.QueryEntities<WireEntityStruct>(NamedExclusiveGroup<WiresGroup>.Group);
var wiresB = wires.ToBuffer().buffer;
for (int endIndex = 0; endIndex < endPorts.Length; endIndex++)
{
PortEntityStruct endPES = entitiesDB.QueryEntity<PortEntityStruct>(endPorts[endIndex]);
@@ -294,11 +299,11 @@ namespace GamecraftModdingAPI.Blocks
PortEntityStruct startPES = entitiesDB.QueryEntity<PortEntityStruct>(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<PortEntityStruct>(portID);
var channels = entitiesDB.QueryEntities<ChannelDataStruct>(NamedExclusiveGroup<ChannelDataGroup>.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<EGID>();
foreach (var (coll, _) in entitiesDB.QueryEntities<BlockPortsStruct>())
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<T>(ExclusiveGroup group, Func<T, bool> isMatch) where T : struct, IEntityComponent
private T[] Search<T>(ExclusiveGroup group, Func<T, bool> isMatch) where T : unmanaged, IEntityComponent
{
FasterList<T> results = new FasterList<T>();
EntityCollection<T> components = entitiesDB.QueryEntities<T>(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();


+ 1
- 1
GamecraftModdingAPI/Blocks/SpawnPoint.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/TextBlock.cs View File

@@ -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))
{
}



+ 1
- 1
GamecraftModdingAPI/Blocks/Timer.cs View File

@@ -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))
{
}



+ 153
- 144
GamecraftModdingAPI/GamecraftModdingAPI.csproj View File

@@ -25,11 +25,16 @@


<!--Start Dependencies-->
<ItemGroup>
<Reference Include="Accessibility">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Accessibility.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll</HintPath>
<Reference Include="IllusionInjector">
<HintPath>..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll</HintPath>
</Reference>
<Reference Include="IllusionPlugin">
<HintPath>..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll</HintPath>
</Reference>
<Reference Include="Analytics">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Analytics.dll</HintPath>
@@ -83,14 +88,14 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\FMOD.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\FMOD.dll</HintPath>
</Reference>
<Reference Include="FullGame">
<HintPath>..\ref\GamecraftPreview_Data\Managed\FullGame.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.AudioBlocks">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.AudioBlocks.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlockCompositionRoot">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockCompositionRoot.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlockEntityFactory">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlockEntityFactory.dll</HintPath>
@@ -135,6 +140,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.Blocks.TimerBlock.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlocksEntityDescriptors">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.CharacterVulnerability">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.CharacterVulnerability.dll</HintPath>
@@ -187,6 +196,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GameOptionsScreen.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.GraphicsScreen">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.Hotbar.Blocks">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.Hotbar.Blocks.dll</HintPath>
@@ -243,66 +256,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.WorldSpaceGuis.dll</HintPath>
</Reference>
<Reference Include="FullGame">
<HintPath>..\ref\GamecraftPreview_Data\Managed\FullGame.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\FullGame.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.BlocksEntityDescriptors">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.BlocksEntityDescriptors.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUI.GraphicsScreen">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUI.GraphicsScreen.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.GUIs.Hotbar.BlueprintsHotbar">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.GUIs.Hotbar.BlueprintsHotbar.dll</HintPath>
</Reference>
<Reference Include="IllusionInjector">
<HintPath>..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\IllusionInjector.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Common">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Input">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Rendering">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
</Reference>
<Reference Include="Svelto.ECS">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll</HintPath>
</Reference>
<Reference Include="Unity.DataFlowGraph">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll</HintPath>
</Reference>
<Reference Include="Unity.Properties.UI">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.Transforms.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TLSModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
</Reference>
<Reference Include="Gamecraft.InventoryTimeRunning">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Gamecraft.InventoryTimeRunning.dll</HintPath>
@@ -379,18 +336,6 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Havok.Physics.Hybrid.dll</HintPath>
</Reference>
<Reference Include="IL3DN_FOG">
<HintPath>..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\IL3DN_FOG.dll</HintPath>
</Reference>
<Reference Include="IllusionPlugin">
<HintPath>..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\IllusionPlugin.dll</HintPath>
</Reference>
<Reference Include="JWT">
<HintPath>..\ref\GamecraftPreview_Data\Managed\JWT.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\JWT.dll</HintPath>
</Reference>
<Reference Include="LZ4">
<HintPath>..\ref\GamecraftPreview_Data\Managed\LZ4.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\LZ4.dll</HintPath>
@@ -407,18 +352,6 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\MultiplayerTest.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\ref\GamecraftPreview_Data\Managed\netstandard.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Novell.Directory.Ldap">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll</HintPath>
</Reference>
<Reference Include="RCX.ScreenshotTaker">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RCX.ScreenshotTaker.dll</HintPath>
@@ -467,6 +400,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ClusterToWireConversion.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Common">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Common.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.ControlsScreen">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.ControlsScreen.dll</HintPath>
@@ -523,6 +460,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Input">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Input.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.MachineEditor">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.MachineEditor.dll</HintPath>
@@ -579,6 +520,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Player.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Rendering">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.dll</HintPath>
</Reference>
<Reference Include="RobocraftX.Rendering.Mock">
<HintPath>..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\RobocraftX.Rendering.Mock.dll</HintPath>
@@ -631,9 +576,13 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\StringFormatter.dll</HintPath>
</Reference>
<Reference Include="Svelto.Common_3">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common_3.dll</HintPath>
<Reference Include="Svelto.Common">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Svelto.Common.dll</HintPath>
</Reference>
<Reference Include="Svelto.ECS">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Svelto.ECS.dll</HintPath>
</Reference>
<Reference Include="Svelto.Services">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.Services.dll</HintPath>
@@ -643,6 +592,62 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Svelto.Tasks.dll</HintPath>
</Reference>
<Reference Include="UltimateDecals">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll</HintPath>
</Reference>
<Reference Include="Unity.Addressables">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Curves">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Curves.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.DefaultGraphPipeline">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.DefaultGraphPipeline.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Graph">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Build.SlimPlayerRuntime">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll</HintPath>
</Reference>
<Reference Include="Unity.Collections">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll</HintPath>
</Reference>
<Reference Include="Unity.Collections.LowLevel.ILSupport">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.LowLevel.ILSupport.dll</HintPath>
</Reference>
<Reference Include="Unity.DataFlowGraph">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.DataFlowGraph.dll</HintPath>
</Reference>
<Reference Include="Unity.Deformations">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Deformations.dll</HintPath>
@@ -655,6 +660,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Entities.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.InternalAPIEngineBridge.002">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.InternalAPIEngineBridge.002.dll</HintPath>
</Reference>
<Reference Include="Unity.Jobs">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Jobs.dll</HintPath>
@@ -699,6 +708,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.Reflection.dll</HintPath>
</Reference>
<Reference Include="Unity.Properties.UI">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Properties.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipeline.Universal.ShaderLibrary">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.RenderPipeline.Universal.ShaderLibrary.dll</HintPath>
@@ -727,9 +740,9 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Unity.Scenes.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.Hybrid.dll</HintPath>
<Reference Include="Unity.Scenes">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Scenes.dll</HintPath>
</Reference>
<Reference Include="Unity.ScriptableBuildPipeline">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.ScriptableBuildPipeline.dll</HintPath>
@@ -751,57 +764,9 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.dll</HintPath>
</Reference>
<Reference Include="UltimateDecals">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UltimateDecals.dll</HintPath>
</Reference>
<Reference Include="Unity.Addressables">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Addressables.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Curves">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Curves.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Curves.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.DefaultGraphPipeline">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.DefaultGraphPipeline.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.DefaultGraphPipeline.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Graph">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Graph.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Animation.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.Build.SlimPlayerRuntime">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Build.SlimPlayerRuntime.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst.Unsafe">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
</Reference>
<Reference Include="Unity.Collections">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Collections.dll</HintPath>
<Reference Include="Unity.Transforms.Hybrid">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Transforms.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.VisualEffectGraph.Runtime">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.VisualEffectGraph.Runtime.dll</HintPath>
@@ -859,6 +824,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DirectorModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.DSPGraphModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.DSPGraphModule.dll</HintPath>
@@ -911,6 +880,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ProfilerModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.ProfilerModule.dll</HintPath>
@@ -963,6 +936,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TilemapModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TLSModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.TLSModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UI.dll</HintPath>
@@ -971,6 +948,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIElementsNativeModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIElementsNativeModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.UIModule.dll</HintPath>
@@ -1027,6 +1008,10 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VideoModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VirtualTexturingModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VirtualTexturingModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.VRModule">
<HintPath>..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\UnityEngine.VRModule.dll</HintPath>
@@ -1047,6 +1032,30 @@
<HintPath>..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\VisualProfiler.dll</HintPath>
</Reference>
<Reference Include="Accessibility">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Accessibility.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Accessibility.dll</HintPath>
</Reference>
<Reference Include="JWT">
<HintPath>..\ref\GamecraftPreview_Data\Managed\JWT.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\JWT.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\ref\GamecraftPreview_Data\Managed\netstandard.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\netstandard.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Novell.Directory.Ldap">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Novell.Directory.Ldap.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst.Unsafe">
<HintPath>..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
<HintPath>..\..\ref\GamecraftPreview_Data\Managed\Unity.Burst.Unsafe.dll</HintPath>
</Reference>
</ItemGroup>
<!--End Dependencies-->
</Project>

+ 4
- 4
GamecraftModdingAPI/Inventory/HotbarEngine.cs View File

@@ -36,13 +36,13 @@ namespace GamecraftModdingAPI.Inventory

public bool SelectBlock(int block, uint playerID, bool cubeSelectedByPick = false)
{
var inputs = entitiesDB.QueryEntities<LocalInputEntityStruct>(InputExclusiveGroups.LocalPlayers);
var inputs = entitiesDB.QueryEntities<LocalInputEntityStruct>(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;
}
}


+ 4
- 4
GamecraftModdingAPI/Players/PlayerEngine.cs View File

@@ -50,10 +50,10 @@ namespace GamecraftModdingAPI.Players
public uint GetLocalPlayer()
{
if (!isReady) return uint.MaxValue;
var localPlayers = entitiesDB.QueryEntities<PlayerIDStruct>(PlayersExclusiveGroups.LocalPlayers);
var localPlayers = entitiesDB.QueryEntities<PlayerIDStruct>(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<PlayerIDStruct>(PlayersExclusiveGroups.RemotePlayers);
var localPlayers = entitiesDB.QueryEntities<PlayerIDStruct>(PlayersExclusiveGroups.RemotePlayers).ToBuffer();
if (localPlayers.count > 0)
{
return localPlayers[0].ID.entityID;
return localPlayers.buffer[0].ID.entityID;
}
return uint.MaxValue;
}


+ 1
- 1
GamecraftModdingAPI/Tests/TestRoot.cs View File

@@ -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) =>
{


Loading…
Cancel
Save