Update to newer Gamecraft version
This commit is contained in:
parent
6c83b44d4e
commit
878ebdb491
4 changed files with 10 additions and 20 deletions
|
@ -20,6 +20,7 @@ using Unity.Mathematics;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
using GamecraftModdingAPI.Utility;
|
using GamecraftModdingAPI.Utility;
|
||||||
|
using Svelto.DataStructures;
|
||||||
|
|
||||||
namespace GamecraftModdingAPI.Blocks
|
namespace GamecraftModdingAPI.Blocks
|
||||||
{
|
{
|
||||||
|
@ -69,9 +70,9 @@ namespace GamecraftModdingAPI.Blocks
|
||||||
public float3 MoveConnectedBlocks(uint blockID, float3 vector)
|
public float3 MoveConnectedBlocks(uint blockID, float3 vector)
|
||||||
{
|
{
|
||||||
Stack<uint> cubeStack = new Stack<uint>();
|
Stack<uint> cubeStack = new Stack<uint>();
|
||||||
Gamecraft.DataStructures.FasterList<uint> cubesToMove = new Gamecraft.DataStructures.FasterList<uint>();
|
FasterList<uint> cubesToMove = new FasterList<uint>();
|
||||||
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToMove, (in GridConnectionsEntityStruct g) => { return false; });
|
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubeStack, cubesToMove, (in GridConnectionsEntityStruct g) => { return false; });
|
||||||
for (int i = 0; i < cubesToMove.Count; i++)
|
for (int i = 0; i < cubesToMove.count; i++)
|
||||||
{
|
{
|
||||||
MoveBlock(cubesToMove[i], vector);
|
MoveBlock(cubesToMove[i], vector);
|
||||||
entitiesDB.QueryEntity<GridConnectionsEntityStruct>(cubesToMove[i], CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false;
|
entitiesDB.QueryEntity<GridConnectionsEntityStruct>(cubesToMove[i], CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false;
|
||||||
|
|
|
@ -13,6 +13,7 @@ using RobocraftX.SimulationModeState;
|
||||||
using RobocraftX.UECS;
|
using RobocraftX.UECS;
|
||||||
using Unity.Entities;
|
using Unity.Entities;
|
||||||
using Svelto.Context;
|
using Svelto.Context;
|
||||||
|
using Svelto.DataStructures;
|
||||||
using Svelto.ECS;
|
using Svelto.ECS;
|
||||||
using Svelto.ECS.EntityStructs;
|
using Svelto.ECS.EntityStructs;
|
||||||
using Unity.Transforms;
|
using Unity.Transforms;
|
||||||
|
@ -37,7 +38,7 @@ namespace GamecraftModdingAPI.Blocks
|
||||||
private Stack<uint> cubesStack = new Stack<uint>();
|
private Stack<uint> cubesStack = new Stack<uint>();
|
||||||
private bool stackInUse = false;
|
private bool stackInUse = false;
|
||||||
|
|
||||||
private Gamecraft.DataStructures.FasterList<uint> cubesList = new Gamecraft.DataStructures.FasterList<uint>();
|
private FasterList<uint> cubesList = new FasterList<uint>();
|
||||||
private bool listInUse = false;
|
private bool listInUse = false;
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
@ -171,7 +172,7 @@ namespace GamecraftModdingAPI.Blocks
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Stack<uint> cubeStack = new Stack<uint>();
|
Stack<uint> cubeStack = new Stack<uint>();
|
||||||
Gamecraft.DataStructures.FasterList<uint> cubeList = new Gamecraft.DataStructures.FasterList<uint>();
|
FasterList<uint> cubeList = new FasterList<uint>();
|
||||||
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubesStack, cubesList, (in GridConnectionsEntityStruct g) => { return g.isIsolator; });
|
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID, cubesStack, cubesList, (in GridConnectionsEntityStruct g) => { return g.isIsolator; });
|
||||||
uint[] res = cubesList.ToArray();
|
uint[] res = cubesList.ToArray();
|
||||||
foreach (var id in res)
|
foreach (var id in res)
|
||||||
|
|
|
@ -253,9 +253,6 @@
|
||||||
<Reference Include="Unity.Addressables">
|
<Reference Include="Unity.Addressables">
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll</HintPath>
|
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Unity.Animation.Rigging">
|
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Animation.Rigging.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Unity.Burst">
|
<Reference Include="Unity.Burst">
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Burst.dll</HintPath>
|
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Burst.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -307,9 +304,6 @@
|
||||||
<Reference Include="Unity.Properties">
|
<Reference Include="Unity.Properties">
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Properties.dll</HintPath>
|
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Properties.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Unity.Rendering.Hybrid">
|
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Rendering.Hybrid.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Unity.RenderPipelines.Core.Runtime">
|
<Reference Include="Unity.RenderPipelines.Core.Runtime">
|
||||||
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
|
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|
|
@ -89,15 +89,9 @@ namespace GamecraftModdingAPI.Utility
|
||||||
/// <param name="extraData">The extra data to pass to the ILogger.
|
/// <param name="extraData">The extra data to pass to the ILogger.
|
||||||
/// This is automatically populated with "OuterException#" and "OuterStacktrace#" entries</param>
|
/// This is automatically populated with "OuterException#" and "OuterStacktrace#" entries</param>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static void LogException(Exception e, Dictionary<string, string> extraData = null)
|
public static void LogException(Exception e, string msg = null, Dictionary<string, string> extraData = null)
|
||||||
{
|
{
|
||||||
Svelto.Console.LogException(e, extraData);
|
Svelto.Console.LogException(e, msg, extraData);
|
||||||
}
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
public static void LogException(string msg, Exception e, Dictionary<string, string> extraData = null)
|
|
||||||
{
|
|
||||||
Svelto.Console.LogException(msg, e, extraData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -108,9 +102,9 @@ namespace GamecraftModdingAPI.Utility
|
||||||
/// <param name="extraData">The extra data to pass to the ILogger.
|
/// <param name="extraData">The extra data to pass to the ILogger.
|
||||||
/// This is implemented similar to LogException(Exception e, Dictionary extraData)'s extraData</param>
|
/// This is implemented similar to LogException(Exception e, Dictionary extraData)'s extraData</param>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static void LogException(object obj, Exception e, Dictionary<string, string> extraData = null)
|
public static void LogException(Exception e, object obj, Dictionary<string, string> extraData = null)
|
||||||
{
|
{
|
||||||
Svelto.Console.LogException(obj.ToString(), e, extraData);
|
Svelto.Console.LogException(e, obj.ToString(), extraData);
|
||||||
}
|
}
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
Loading…
Reference in a new issue