aboutsummaryrefslogtreecommitdiff
path: root/go/game/map.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-24 12:17:26 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-07-28 18:03:10 +0200
commit749dc58ced17662d9f6dd40bb44d315d12d3d48b (patch)
tree170a957d296dc82467310b7b22f66d2ad440dff7 /go/game/map.go
parentce875a8454265ac4a17be25eeaa6e0b136936a56 (diff)
downloadmuhqs-game-749dc58ced17662d9f6dd40bb44d315d12d3d48b.tar.gz
muhqs-game-749dc58ced17662d9f6dd40bb44d315d12d3d48b.zip
add random challange aupport to the client
Diffstat (limited to 'go/game/map.go')
-rw-r--r--go/game/map.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/go/game/map.go b/go/game/map.go
index 2b0bebd7..be541cdd 100644
--- a/go/game/map.go
+++ b/go/game/map.go
@@ -285,6 +285,12 @@ func (m *Map) FreeTiles() []*Tile {
return m.FilterTiles(func(t *Tile) bool { return t.IsFree() })
}
+func (m *Map) AvailableTilesFor(c *Card) []*Tile {
+ return m.FilterTiles(func(t *Tile) bool {
+ return t.IsAvailableForCard(c)
+ })
+}
+
func (m *Map) distributeStoreCards(cards PileOfCards, rand *rand.Rand) {
nStores := len(m.Stores)
stores := make([]*Store, 0, nStores)