From aa4df38eadc66d5d1c1f51aa1e219d63ec64dfd6 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 7 Jun 2020 18:21:44 +0100 Subject: [PATCH] Swap kind to bytes and reduce chunk size --- pkg/game/atlas.go | 2 +- pkg/game/world.go | 2 +- pkg/persistence/persistence.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/game/atlas.go b/pkg/game/atlas.go index fefcaf2..e981005 100644 --- a/pkg/game/atlas.go +++ b/pkg/game/atlas.go @@ -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 { diff --git a/pkg/game/world.go b/pkg/game/world.go index 398d728..27ea969 100644 --- a/pkg/game/world.go +++ b/pkg/game/world.go @@ -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 } } diff --git a/pkg/persistence/persistence.go b/pkg/persistence/persistence.go index 85ffa18..db0e868 100644 --- a/pkg/persistence/persistence.go +++ b/pkg/persistence/persistence.go @@ -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 {