rove/pkg/game/command.go
2020-06-04 21:59:00 +01:00

14 lines
374 B
Go

package game
import "github.com/google/uuid"
// A command is simply a function that acts on the a given rover in the world
type Command func() error
// CommandMove will move the rover in question
func (w *World) CommandMove(id uuid.UUID, bearing float64, duration float64) Command {
return func() error {
_, err := w.MoveRover(id, bearing, duration)
return err
}
}