Skip to content

Commit

Permalink
Add Size method to Rtree
Browse files Browse the repository at this point in the history
  • Loading branch information
200sc committed Mar 19, 2019
1 parent 8556c52 commit dc01c5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions collision/rtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit dc01c5a

Please sign in to comment.