From 6acdf43bc056ed8c4c09508d700f4ff24934c920 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 12 Jan 2023 20:58:14 +0100 Subject: implement unit movement --- go/game/map.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'go/game/map.go') diff --git a/go/game/map.go b/go/game/map.go index cecce9ca..ebf59d25 100644 --- a/go/game/map.go +++ b/go/game/map.go @@ -1,8 +1,8 @@ package game import ( - "fmt" "errors" + "fmt" "io" "log" "math/rand" @@ -20,7 +20,8 @@ const ( BASE_URL string = "localhost:8000/" MAP_URL_PART string = "html/build/maps" - DEFAULT_RESSOURCE_GAIN int = 5 + DEFAULT_RESSOURCE_GAIN int = 5 + DEFAULT_START_DECK string = "3 misc/farmer" ) type MapYml struct { @@ -32,6 +33,7 @@ type Map struct { Tiles [][]Tile symbols map[string]string RessourceGain int + StartDeckList string } func readMap(r io.Reader) (*Map, error) { @@ -52,7 +54,7 @@ func ParseMap(data []byte) (*Map, error) { mapYml.Symbols[" "] = "neutral" - m := &Map{[][]Tile{}, mapYml.Symbols, DEFAULT_RESSOURCE_GAIN} + m := &Map{[][]Tile{}, mapYml.Symbols, DEFAULT_RESSOURCE_GAIN, DEFAULT_START_DECK} rows := strings.Split(mapYml.Map, "\n") for y := 0; y < len(rows); y++ { -- cgit v1.2.3