aboutsummaryrefslogtreecommitdiff
path: root/go/game/playerControl.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-12-03 15:24:37 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-01-27 16:43:54 +0100
commit9b71fe182e8e42ea2b7d3ba42a0f2767e5e5a246 (patch)
tree6c7fb471efa87cd4f5f2e5c00fa067c65d10ca7e /go/game/playerControl.go
parent771b85c660dfd03f786aaf86ff86a9416e361235 (diff)
downloadmuhqs-game-9b71fe182e8e42ea2b7d3ba42a0f2767e5e5a246.tar.gz
muhqs-game-9b71fe182e8e42ea2b7d3ba42a0f2767e5e5a246.zip
prompt the user to order its triggers
All TriggeredAction are passed in the wrapper action DeclareTriggeredActionsAction to the controller of the triggers. It is expected to receive an ordered list back from the user again wrapped in a DeclareTriggeredActionsAction. The triggered actions will be declared in from first to last.
Diffstat (limited to 'go/game/playerControl.go')
-rw-r--r--go/game/playerControl.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/go/game/playerControl.go b/go/game/playerControl.go
index eea6a19b..94c8be7e 100644
--- a/go/game/playerControl.go
+++ b/go/game/playerControl.go
@@ -12,6 +12,7 @@ const (
ResolvedActionNotification
PriorityNotification
TargetSelectionPrompt
+ DeclareTriggeredActionsPrompt
)
func (n PlayerNotificationType) String() string {
@@ -24,6 +25,8 @@ func (n PlayerNotificationType) String() string {
return "PriorityNotification"
case TargetSelectionPrompt:
return "TargetSelectionPrompt"
+ case DeclareTriggeredActionsPrompt:
+ return "DeclareTriggeredActionsPrompt"
default:
log.Panicf("Unhandled notification %d", n)
return ""
@@ -86,6 +89,10 @@ func newHandCardSelectionPrompt(p *Player, min, max int) PlayerNotification {
return newTargetSelectionPrompt(a, desc)
}
+func newDeclareTriggeredActionsPrompt(triggeredActions []*TriggeredAction) PlayerNotification {
+ return PlayerNotification{DeclareTriggeredActionsPrompt, triggeredActions, nil}
+}
+
type PlayerControl interface {
Player() *Player
RecvAction() Action