Simplify - remove duplicate command types in favor of a better defined Command type in proto

This commit is contained in:
Marc Di Luzio 2020-07-10 00:12:54 +01:00
parent 7d780d05bd
commit 96a137ad2f
9 changed files with 370 additions and 471 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/mdiluz/rove/pkg/atlas"
"github.com/mdiluz/rove/pkg/bearing"
"github.com/mdiluz/rove/pkg/objects"
"github.com/mdiluz/rove/pkg/rove"
"github.com/mdiluz/rove/pkg/vector"
"github.com/stretchr/testify/assert"
)
@ -272,7 +273,7 @@ func TestWorld_RoverRepair(t *testing.T) {
assert.NoError(t, err, "couldn't get rover info")
assert.Equal(t, originalInfo.Integrity-1, newinfo.Integrity, "rover should have lost integrity")
err = world.ExecuteCommand(&Command{Command: CommandRepair}, a)
err = world.ExecuteCommand(&Command{Command: rove.CommandType_repair}, a)
assert.NoError(t, err, "Failed to repair rover")
newinfo, err = world.GetRover(a)
@ -286,7 +287,7 @@ func TestWorld_RoverRepair(t *testing.T) {
assert.NoError(t, err, "Failed to stash")
assert.Equal(t, objects.SmallRock, o, "Failed to get correct object")
err = world.ExecuteCommand(&Command{Command: CommandRepair}, a)
err = world.ExecuteCommand(&Command{Command: rove.CommandType_repair}, a)
assert.NoError(t, err, "Failed to repair rover")
newinfo, err = world.GetRover(a)