remove method
Removes a node from the QuadTree
Returns true if the node was found and removed, false otherwise
Implementation
bool remove(Node<E> node, Size nodeSize) {
if (!_isNodeInBounds(node, nodeSize)) {
return false;
}
if (isLeaf) {
final removed = _nodes!.remove(node);
if (removed) {
_totalNodeCount--;
}
return removed;
}
// Try to remove from child quadrants
for (final child in _children!) {
if (child != null && child.remove(node, nodeSize)) {
_totalNodeCount--;
_tryMergeChildren();
return true;
}
}
return false;
}