Add Quadtree.Count

This commit is contained in:
Stefan Müller 2025-08-27 19:38:05 +02:00
parent a52b19bfa4
commit eee2cd5be4

View File

@ -11,7 +11,6 @@ namespace SpatialCollections
/// </summary>
// 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<int>();
}
public int Count => _items.Count;
public void Add(IWorldObject obj)
{
var itemIndex = _items.Count;