From cf29758fbd8bb1cc0b82a37351e2aa7ddbd2586f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 3 Dec 2023 15:24:37 +0100 Subject: 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. --- go/game/playerControl.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'go/game/playerControl.go') 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 -- cgit v1.2.3