From 97d3be000b7aba3748c1283c645b0ce01f131939 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Fri, 10 Jul 2020 18:14:32 +0100 Subject: [PATCH] Re-order some World members --- pkg/rove/world.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkg/rove/world.go b/pkg/rove/world.go index 490747b..dcb39ea 100644 --- a/pkg/rove/world.go +++ b/pkg/rove/world.go @@ -18,32 +18,29 @@ import ( // World describes a self contained universe and everything in it type World struct { + // TicksPerDay is the amount of ticks in a single day + TicksPerDay int `json:"ticks-per-day"` + + // Current number of ticks from the start + CurrentTicks int `json:"current-ticks"` + // Rovers is a id->data map of all the rovers in the game Rovers map[string]Rover `json:"rovers"` // Atlas represends the world map of chunks and tiles Atlas atlas.Atlas `json:"atlas"` - // Mutex to lock around all world operations - worldMutex sync.RWMutex - // Commands is the set of currently executing command streams per rover CommandQueue map[string]CommandStream `json:"commands"` - // Incoming represents the set of commands to add to the queue at the end of the current tick CommandIncoming map[string]CommandStream `json:"incoming"` + // Mutex to lock around all world operations + worldMutex sync.RWMutex // Mutex to lock around command operations cmdMutex sync.RWMutex - // Set of possible words to use for names words []string - - // TicksPerDay is the amount of ticks in a single day - TicksPerDay int `json:"ticks-per-day"` - - // Current number of ticks from the start - CurrentTicks int `json:"current-ticks"` } var wordsFile = os.Getenv("WORDS_FILE")