aboutsummaryrefslogtreecommitdiff
path: root/go/game
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-03-26 21:31:47 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:11 +0200
commitf3dce6f8edb37284d46de2c396396d35cd61c137 (patch)
tree6602e6f59537a4eb60d0866b89de74fc0e33bf15 /go/game
parentaef4d5ea938f55831e70e28ae2a19c1b23797d8a (diff)
downloadmuhqs-game-f3dce6f8edb37284d46de2c396396d35cd61c137.tar.gz
muhqs-game-f3dce6f8edb37284d46de2c396396d35cd61c137.zip
check if Targets allow a selection
This fixes highlighting when an action needs no targets at all.
Diffstat (limited to 'go/game')
-rw-r--r--go/game/targets.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/go/game/targets.go b/go/game/targets.go
index fb393057..58f19dc1 100644
--- a/go/game/targets.go
+++ b/go/game/targets.go
@@ -271,6 +271,16 @@ func (targets *Targets) RequireSelection() bool {
return false
}
+func (targets *Targets) AllowSelection() bool {
+ for _, t := range targets.ts {
+ if t.AllowSelection() {
+ return true
+ }
+ }
+
+ return false
+}
+
func conjunction(constraints ...TargetConstraintFunc) TargetConstraintFunc {
return func(t interface{}) error {
for _, constraint := range constraints {