Exemple #1
0
func insertUnitToKdTree(tree *kdtree.T, unit Movable) *kdtree.T {
	unitT := new(kdtree.T)
	unitT.Point = kdtree.Point{float64(unit.GetX()), float64(unit.GetY())}
	unitT.Data = unit
	return tree.Insert(unitT)
}
Exemple #2
0
func insertUnitToKdTree(tree *kdtree.T, unit *Unit) *kdtree.T {
	unitT := new(kdtree.T)
	unitT.Point = kdtree.Point{float64(unit.X), float64(unit.Y)}
	unitT.Data = unit
	return tree.Insert(unitT)
}