Browse Source

Update to newer Gamecraft version

tags/v0.1.3.0
NorbiPeti 4 years ago
parent
commit
878ebdb491
Signed by: NorbiPeti <szatmari.norbert.peter@gmail.com> GPG Key ID: DBA4C4549A927E56
4 changed files with 10 additions and 20 deletions
  1. +3
    -2
      GamecraftModdingAPI/Blocks/MovementEngine.cs
  2. +3
    -2
      GamecraftModdingAPI/Blocks/SignalEngine.cs
  3. +0
    -6
      GamecraftModdingAPI/GamecraftModdingAPI.csproj
  4. +4
    -10
      GamecraftModdingAPI/Utility/Logging.cs

+ 3
- 2
GamecraftModdingAPI/Blocks/MovementEngine.cs View File

@@ -20,6 +20,7 @@ using Unity.Mathematics;
using UnityEngine;

using GamecraftModdingAPI.Utility;
using Svelto.DataStructures;

namespace GamecraftModdingAPI.Blocks
{
@@ -69,9 +70,9 @@ namespace GamecraftModdingAPI.Blocks
public float3 MoveConnectedBlocks(uint blockID, float3 vector)
{
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; });
for (int i = 0; i < cubesToMove.Count; i++)
for (int i = 0; i < cubesToMove.count; i++)
{
MoveBlock(cubesToMove[i], vector);
entitiesDB.QueryEntity<GridConnectionsEntityStruct>(cubesToMove[i], CommonExclusiveGroups.OWNED_BLOCKS_GROUP).isProcessed = false;


+ 3
- 2
GamecraftModdingAPI/Blocks/SignalEngine.cs View File

@@ -13,6 +13,7 @@ using RobocraftX.SimulationModeState;
using RobocraftX.UECS;
using Unity.Entities;
using Svelto.Context;
using Svelto.DataStructures;
using Svelto.ECS;
using Svelto.ECS.EntityStructs;
using Unity.Transforms;
@@ -37,7 +38,7 @@ namespace GamecraftModdingAPI.Blocks
private Stack<uint> cubesStack = new Stack<uint>();
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;

public void Dispose()
@@ -171,7 +172,7 @@ namespace GamecraftModdingAPI.Blocks
else
{
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; });
uint[] res = cubesList.ToArray();
foreach (var id in res)


+ 0
- 6
GamecraftModdingAPI/GamecraftModdingAPI.csproj View File

@@ -253,9 +253,6 @@
<Reference Include="Unity.Addressables">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll</HintPath>
</Reference>
<Reference Include="Unity.Animation.Rigging">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Animation.Rigging.dll</HintPath>
</Reference>
<Reference Include="Unity.Burst">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Burst.dll</HintPath>
</Reference>
@@ -307,9 +304,6 @@
<Reference Include="Unity.Properties">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Properties.dll</HintPath>
</Reference>
<Reference Include="Unity.Rendering.Hybrid">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.Rendering.Hybrid.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Runtime">
<HintPath>..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll</HintPath>
</Reference>


+ 4
- 10
GamecraftModdingAPI/Utility/Logging.cs View File

@@ -89,15 +89,9 @@ namespace GamecraftModdingAPI.Utility
/// <param name="extraData">The extra data to pass to the ILogger.
/// This is automatically populated with "OuterException#" and "OuterStacktrace#" entries</param>
[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);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void LogException(string msg, Exception e, Dictionary<string, string> extraData = null)
{
Svelto.Console.LogException(msg, e, extraData);
Svelto.Console.LogException(e, msg, extraData);
}

/// <summary>
@@ -108,9 +102,9 @@ namespace GamecraftModdingAPI.Utility
/// <param name="extraData">The extra data to pass to the ILogger.
/// This is implemented similar to LogException(Exception e, Dictionary extraData)'s extraData</param>
[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)]


Loading…
Cancel
Save