Convert bearings to compass points and locations to int coords

This commit is contained in:
Marc Di Luzio 2020-06-05 16:37:52 +01:00
parent ae369715ec
commit be0f4f1aff
10 changed files with 187 additions and 35 deletions

View file

@ -71,11 +71,11 @@ func TestWorld_GetSetMovePosition(t *testing.T) {
assert.NoError(t, err, "Failed to set position for rover")
assert.Equal(t, pos, newpos, "Failed to correctly set position for rover")
bearing := 0.0
duration := 1.0
bearing := North
duration := 1
newpos, err = world.MoveRover(a, bearing, duration)
assert.NoError(t, err, "Failed to set position for rover")
pos.Add(Vector{0, attribs.Speed * float64(duration)}) // We should have move one unit of the speed north
pos.Add(Vector{0, attribs.Speed * duration}) // We should have move one unit of the speed north
assert.Equal(t, pos, newpos, "Failed to correctly move position for rover")
}