aboutsummaryrefslogtreecommitdiff
path: root/go/game
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-12-09 10:28:42 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:54 +0100
commit53f15bcda076043dbd6763fc85f6bd85cc7f3e71 (patch)
treef27aabb3af38d453736768b7926ff1eb9c0f99fe /go/game
parent35ce4679a4c48ae25ed8cbe108f0bc2430af8b8d (diff)
downloadmuhqs-game-53f15bcda076043dbd6763fc85f6bd85cc7f3e71.tar.gz
muhqs-game-53f15bcda076043dbd6763fc85f6bd85cc7f3e71.zip
support special wall, gate and tower tile selection
Diffstat (limited to 'go/game')
-rw-r--r--go/game/tile.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/go/game/tile.go b/go/game/tile.go
index f8d160da..47f9a5d6 100644
--- a/go/game/tile.go
+++ b/go/game/tile.go
@@ -10,6 +10,8 @@ type TileType int
const (
neutral TileType = iota + 1
tower
+ gate
+ wall
house
farm
street
@@ -24,6 +26,10 @@ func (t TileType) String() string {
return "neutral"
case tower:
return "tower"
+ case wall:
+ return "wall"
+ case gate:
+ return "gate"
case house:
return "house"
case farm:
@@ -40,9 +46,15 @@ func (t TileType) String() string {
return ""
}
+func (t TileType) IsFortification() bool {
+ return t == TileTypes.Wall || t == TileTypes.Gate || t == TileTypes.Tower
+}
+
var TileTypes = struct {
Neutral TileType
Tower TileType
+ Wall TileType
+ Gate TileType
House TileType
Farm TileType
Street TileType
@@ -52,6 +64,8 @@ var TileTypes = struct {
}{
Neutral: neutral,
Tower: tower,
+ Wall: wall,
+ Gate: gate,
House: house,
Farm: farm,
Street: street,
@@ -63,6 +77,8 @@ var TileTypes = struct {
var TileNames = map[string]TileType{
"neutral": neutral,
"tower": tower,
+ "wall": wall,
+ "gate": gate,
"house": house,
"farm": farm,
"street": street,