Add cron tick of command queue

This commit is contained in:
Marc Di Luzio 2020-06-06 15:52:03 +01:00
parent 0a0a32cf58
commit 573bfbf9c7
7 changed files with 113 additions and 13 deletions

View file

@ -26,6 +26,9 @@ func TestCommand_Move(t *testing.T) {
moveCommand := Command{Command: CommandMove, Bearing: bearing.String(), Duration: duration}
assert.NoError(t, world.Enqueue(a, moveCommand), "Failed to execute move command")
// Tick the world
world.ExecuteCommandQueues()
newpos, err := world.RoverPosition(a)
assert.NoError(t, err, "Failed to set position for rover")
pos.Add(Vector{0.0, duration * attribs.Speed}) // We should have moved duration*speed north