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-08-20 15:57:09 +0200
commitab1125a0d3b3bef3125f46672b7b2bcc3be98c85 (patch)
tree50e6da6b95e491fce08f8c8ad27edb0b1939de59 /go/game
parent8fe075da12dab572b0bc1fdbc1c2f96b02ce8381 (diff)
downloadmuhqs-game-ab1125a0d3b3bef3125f46672b7b2bcc3be98c85.tar.gz
muhqs-game-ab1125a0d3b3bef3125f46672b7b2bcc3be98c85.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,