Simplify collection initialization
This commit is contained in:
parent
09ac8d0433
commit
f6e5a34278
@ -60,8 +60,8 @@ namespace SpatialCollections
|
||||
_maxLeafSize = maxLeafSize;
|
||||
_maxTreeDepth = maxTreeDepth;
|
||||
_getPositionCallback = getPositionCallback;
|
||||
_vertices = new List<QuadtreeVertex>() { new(-1, 0) };
|
||||
_items = new List<QuadtreeItem<T>>();
|
||||
_vertices = [new(-1, 0)];
|
||||
_items = [];
|
||||
_rootBoundingBox = new Rectangle(Vector2.Zero, Vector2.Zero);
|
||||
_queryStack = new Stack<QuadtreeQuery>();
|
||||
_vertexStack = new Stack<int>();
|
||||
|
@ -43,7 +43,7 @@ namespace QuadtreeTests
|
||||
public void TestQuery()
|
||||
{
|
||||
AddEntitiesAndAssertCount();
|
||||
List<TestEntity> result = new();
|
||||
List<TestEntity> result = [];
|
||||
_quadtree.Query(new Rectangle(new Vector2(2.5f, 2.5f), new Vector2(10.0f, 10.0f)), result);
|
||||
Assert.That(result, Has.Count.EqualTo(2));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user