rove/pkg/game/command.go
Marc Di Luzio d4d82c38e0 Add "broadcast" command
This will send a readable ascii triplet to all rovers in range
2020-07-09 22:05:12 +01:00

32 lines
848 B
Go

package game
const (
// CommandMove Moves the rover in the chosen bearing
CommandMove = "move"
// CommandStash Will attempt to stash the object at the current location
CommandStash = "stash"
// CommandRepair Will attempt to repair the rover with an inventory object
CommandRepair = "repair"
// CommandRecharge Will use one tick to charge the rover
CommandRecharge = "recharge"
// CommandBroadcast will broadcast a message to nearby rovers within range
CommandBroadcast = "broadcast"
)
// Command represends a single command to execute
type Command struct {
Command string `json:"command"`
// Used in the move command
Bearing string `json:"bearing,omitempty"`
// Used in the broadcast command
Message []byte `json:"message,omitempty"`
}
// CommandStream is a list of commands to execute in order
type CommandStream []Command