From f9ab2cfdb25eb3fcd85868a2e375326a9c8b6022 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 15 Feb 2023 13:13:06 +0100 Subject: intermediate commit * fix a lot of target and action bugs * check target selection before adding it to the prompt * use the store view for stores on the map * fix card highlighting in CardGrid * Only prompt for Upkeep-/DiscardActions if appropriate * Add helper for areaEffects granting new FullActions * Add Target() helper selecting the first target to the Action interface * Fix BuyAction and DiscardAction targets * Remember the stores a player has seen --- go/game/playerControl.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'go/game/playerControl.go') diff --git a/go/game/playerControl.go b/go/game/playerControl.go index dda1a736..eea6a19b 100644 --- a/go/game/playerControl.go +++ b/go/game/playerControl.go @@ -8,12 +8,28 @@ import ( type PlayerNotificationType int const ( - DeclaredActionNotification = iota + DeclaredActionNotification PlayerNotificationType = iota ResolvedActionNotification PriorityNotification TargetSelectionPrompt ) +func (n PlayerNotificationType) String() string { + switch n { + case DeclaredActionNotification: + return "DeclaredActionNotification" + case ResolvedActionNotification: + return "ResolvedActionNotification" + case PriorityNotification: + return "PriorityNotification" + case TargetSelectionPrompt: + return "TargetSelectionPrompt" + default: + log.Panicf("Unhandled notification %d", n) + return "" + } +} + func (n PlayerNotification) IsPriorityNotification() bool { return n.Notification == PriorityNotification } @@ -61,7 +77,6 @@ func newUpkeepPrompt(p *Player) PlayerNotification { func newBuyPrompt(p *Player) PlayerNotification { a := newBuyAction(p) prompt := newTargetSelectionPrompt(a, "Select a card to buy") - log.Println("sending buy prompt with ctx", prompt) return prompt } -- cgit v1.2.3