More de-scope - remove duration on move command
This isn't even needed, as commands can just be queued up
This commit is contained in:
parent
383e834cef
commit
2f6465987d
10 changed files with 97 additions and 134 deletions
|
@ -19,9 +19,8 @@ func TestCommand_Move(t *testing.T) {
|
|||
err = world.WarpRover(a, pos)
|
||||
assert.NoError(t, err, "Failed to set position for rover")
|
||||
|
||||
var duration = 1
|
||||
// Try the move command
|
||||
moveCommand := Command{Command: CommandMove, Bearing: "N", Duration: duration}
|
||||
moveCommand := Command{Command: CommandMove, Bearing: "N"}
|
||||
assert.NoError(t, world.Enqueue(a, moveCommand), "Failed to execute move command")
|
||||
|
||||
// Tick the world
|
||||
|
@ -30,6 +29,6 @@ func TestCommand_Move(t *testing.T) {
|
|||
|
||||
newPos, err := world.RoverPosition(a)
|
||||
assert.NoError(t, err, "Failed to set position for rover")
|
||||
pos.Add(vector.Vector{X: 0.0, Y: int(duration)})
|
||||
pos.Add(vector.Vector{X: 0.0, Y: 1})
|
||||
assert.Equal(t, pos, newPos, "Failed to correctly set position for rover")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue