Huge Instance -> Rover refactor, for clarification
This commit is contained in:
parent
33f25a7414
commit
0fbad15c01
10 changed files with 96 additions and 96 deletions
|
@ -2,10 +2,10 @@ package game
|
|||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
// A command is simply a function that acts on the a given instance in the world
|
||||
// A command is simply a function that acts on the a given rover in the world
|
||||
type Command func() error
|
||||
|
||||
// CommandMove will move the instance in question
|
||||
// CommandMove will move the rover in question
|
||||
func (w *World) CommandMove(id uuid.UUID, bearing float64, duration int64) Command {
|
||||
return func() error {
|
||||
// TODO: Calculate the move itself
|
||||
|
@ -19,6 +19,6 @@ func (w *World) CommandMove(id uuid.UUID, bearing float64, duration int64) Comma
|
|||
// TODO: Two spawn commands with the same id could trigger a fail later on, we should prevent that somehow
|
||||
func (w *World) CommandSpawn(id uuid.UUID) Command {
|
||||
return func() error {
|
||||
return w.Spawn(id)
|
||||
return w.SpawnRover(id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue