Swap kind to bytes and reduce chunk size

This commit is contained in:
Marc Di Luzio 2020-06-07 18:21:44 +01:00
parent ceca4eb7fa
commit aa4df38ead
3 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@ package game
import "fmt"
// Kind represents the type of a tile on the map
type Kind int
type Kind byte
// Chunk represents a fixed square grid of tiles
type Chunk struct {

View file

@ -32,7 +32,7 @@ func NewWorld() *World {
return &World{
Rovers: make(map[uuid.UUID]Rover),
CommandQueue: make(map[uuid.UUID]CommandStream),
Atlas: NewAtlas(2, 10), // TODO: Choose an appropriate world size
Atlas: NewAtlas(2, 8), // TODO: Choose an appropriate world size
}
}

View file

@ -30,7 +30,7 @@ func jsonPath(name string) string {
// Save will serialise the interface into a json file
func Save(name string, data interface{}) error {
path := jsonPath(name)
if b, err := json.MarshalIndent(data, "", "\t"); err != nil {
if b, err := json.MarshalIndent(data, "", " "); err != nil {
return err
} else {
if err := ioutil.WriteFile(jsonPath(name), b, os.ModePerm); err != nil {