From c464d1985723ef086d764f66b362e449889a5126 Mon Sep 17 00:00:00 2001 From: Solargale Date: Sun, 21 Jun 2020 20:32:36 -0600 Subject: [PATCH] Got rid of previous material system, now uses enumerators and item ids. Also imported QuadTree.cs so we can have entity collision. --- Collector/src/ThirdPartyCode/QuadTree.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Collector/src/ThirdPartyCode/QuadTree.cs b/Collector/src/ThirdPartyCode/QuadTree.cs index f8d8090..7f775d9 100644 --- a/Collector/src/ThirdPartyCode/QuadTree.cs +++ b/Collector/src/ThirdPartyCode/QuadTree.cs @@ -10,8 +10,8 @@ namespace QuadTree public class QuadTree { - private static Stack branchPool = new Stack(); - private static Stack leafPool = new Stack(); + private static Stack _branchPool = new Stack(); + private static Stack _leafPool = new Stack(); private readonly Branch _root; private readonly int _splitCount; @@ -49,8 +49,8 @@ namespace QuadTree public static void ClearPools() { - branchPool = new Stack(); - leafPool = new Stack(); + _branchPool = new Stack(); + _leafPool = new Stack(); } @@ -160,7 +160,7 @@ namespace QuadTree private static Branch CreateBranch(QuadTree tree, Branch parent, int branchDepth, ref Quad quad) { - var branch = branchPool.Count > 0 ? branchPool.Pop() : new Branch(); + var branch = _branchPool.Count > 0 ? _branchPool.Pop() : new Branch(); branch.Tree = tree; branch.Parent = parent; branch.Split = false; @@ -176,7 +176,7 @@ namespace QuadTree private static Leaf CreateLeaf(T value, ref Quad quad) { - var leaf = leafPool.Count > 0 ? leafPool.Pop() : new Leaf(); + var leaf = _leafPool.Count > 0 ? _leafPool.Pop() : new Leaf(); leaf.Value = value; leaf.Quad = quad; return leaf; @@ -201,14 +201,14 @@ namespace QuadTree for (var i = 0; i < 4; ++i) { if (Branches[i] == null) continue; - branchPool.Push(Branches[i]); + _branchPool.Push(Branches[i]); Branches[i].Clear(); Branches[i] = null; } foreach (var t in Leaves) { - leafPool.Push(t); + _leafPool.Push(t); t.Branch = null; t.Value = default; }