diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-12 20:58:14 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-01-26 22:17:17 +0100 |
| commit | 6acdf43bc056ed8c4c09508d700f4ff24934c920 (patch) | |
| tree | cb5b8a185a1fe37038406fbe7577a359516b6818 /go/game/map.go | |
| parent | 2f49c5e7030b63e8f4d2a8d0d4cb55691ef1fb3a (diff) | |
| download | muhqs-game-6acdf43bc056ed8c4c09508d700f4ff24934c920.tar.gz muhqs-game-6acdf43bc056ed8c4c09508d700f4ff24934c920.zip | |
implement unit movement
Diffstat (limited to 'go/game/map.go')
| -rw-r--r-- | go/game/map.go | 8 |
1 files changed, 5 insertions, 3 deletions
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++ { |
