Move default rover params to function

This commit is contained in:
Marc Di Luzio 2020-07-19 18:23:11 +01:00
parent faa1271c5a
commit ddbbdce1f8
2 changed files with 15 additions and 10 deletions

View file

@ -8,7 +8,6 @@ import (
"os"
"sync"
"github.com/google/uuid"
"github.com/mdiluz/rove/pkg/atlas"
"github.com/mdiluz/rove/pkg/maths"
"github.com/mdiluz/rove/proto/roveapi"
@ -78,15 +77,7 @@ func (w *World) SpawnRover() (string, error) {
defer w.worldMutex.Unlock()
// Initialise the rover
rover := Rover{
Range: 4,
Integrity: 10,
MaximumIntegrity: 10,
Capacity: 10,
Charge: 10,
MaximumCharge: 10,
Name: uuid.New().String(),
}
rover := DefaultRover()
// Assign a random name if we have words
if len(w.words) > 0 {