From dc01c5a8006053689837eeab1da896c132e87ce9 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 18 Mar 2019 21:08:43 -0500 Subject: [PATCH] Add Size method to Rtree --- collision/rtree.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/collision/rtree.go b/collision/rtree.go index 8bf9a169..49d84616 100644 --- a/collision/rtree.go +++ b/collision/rtree.go @@ -22,6 +22,10 @@ type Rtree struct { height int } +func (tree *Rtree) Size() int { + return tree.size +} + // NewTree creates a new R-tree instance. func newTree(MinChildren, MaxChildren int) *Rtree { rt := Rtree{MinChildren: MinChildren, MaxChildren: MaxChildren} @@ -307,6 +311,7 @@ func (tree *Rtree) Delete(obj *Space) bool { for i, e := range n.entries { if e.obj == obj { ind = i + break } } if ind < 0 {