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

@ -70,6 +70,17 @@ const (
CommandMove = "move"
)
const (
BearingNorth = "North"
BearingNorthEast
BearingEast
BearingSouthEast
BearingSouth
BearingSouthWest
BearingWest
BearingNorthWest
)
// Command describes a single command to execute
// it contains the type, and then any members used for each command type
type Command struct {
@ -77,8 +88,8 @@ type Command struct {
Command string `json:"command"`
// Used for CommandMove
Bearing float64 `json:"bearing"` // The direction to move in degrees
Duration float64 `json:"duration"` // The duration of the move in seconds
Bearing string `json:"bearing"` // The direction to move on a compass in short (NW) or long (NorthWest) form
Duration int `json:"duration"` // The duration of the move in ticks
}
// ================