Removed the MiniObstacle nonsense.
This commit is contained in:
parent
b074dda677
commit
2b710ef40d
29
player.go
29
player.go
@ -1,7 +1,6 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"math/rand"
|
||||
|
||||
@ -141,31 +140,3 @@ func (p *SimplePlayer) probe(destination vector.Point2d) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// MiniObstacle is a convenient way to encode/decode between the [4]int -> server.Obstacle
|
||||
type MiniObstacle [4]int
|
||||
|
||||
// id is used to calculate a key for use in maps
|
||||
func (mo *MiniObstacle) Id() string {
|
||||
return fmt.Sprintf(
|
||||
"%x%x%x%x",
|
||||
mo[0],
|
||||
mo[1],
|
||||
mo[2],
|
||||
mo[3],
|
||||
)
|
||||
}
|
||||
|
||||
func (mo MiniObstacle) String() string {
|
||||
return mo.Id()
|
||||
}
|
||||
|
||||
// ToObstacle is where the conversion magic happens
|
||||
func (mo *MiniObstacle) ToObstacle() server.Obstacle {
|
||||
return server.Obstacle{
|
||||
Bounds: vector.AABB2d{
|
||||
A: vector.Point2d{X: float32(mo[0]), Y: float32(mo[1])},
|
||||
B: vector.Point2d{X: float32(mo[2]), Y: float32(mo[3])},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user