From eee2cd5be4872e123a02e2838469d885ed137732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20M=C3=BCller?= Date: Wed, 27 Aug 2025 19:38:05 +0200 Subject: [PATCH] Add Quadtree.Count --- Quadtree/Quadtree.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Quadtree/Quadtree.cs b/Quadtree/Quadtree.cs index 9a55611..7347bb4 100644 --- a/Quadtree/Quadtree.cs +++ b/Quadtree/Quadtree.cs @@ -11,7 +11,6 @@ namespace SpatialCollections /// // TODO: Support for moving objects without having to remove and re-add them. // TODO: Add method to prune empty leaves. An empty leaf is not removed automatically when its last object is removed. - // TODO: Add unit tests. public class Quadtree { // TODO: It should be possible to calculate whether average query time will be better with or without split, without resorting to max leaf size and max tree depth. @@ -67,6 +66,8 @@ namespace SpatialCollections _vertexStack = new Stack(); } + public int Count => _items.Count; + public void Add(IWorldObject obj) { var itemIndex = _items.Count;