From 67faa0f3bf6fb047d19372c9b671a45887b99f6e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 3 Sep 2025 12:37:52 +0200 Subject: implement the patrician --- go/game/action.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'go/game/action.go') diff --git a/go/game/action.go b/go/game/action.go index 856ea6bc..91ea223c 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -660,6 +660,18 @@ type FreeAction struct { desc string } +// newControllerCostFunc returns a new cost function checking the controller's resource and decreasing it accordingly. +func newControllerResourceCostFunc(p Permanent, amount int) ActionCostFunc { + return func(s *LocalState) bool { + c := p.Controller() + if c.Resource < amount { + return false + } + c.Resource -= amount + return true + } +} + func NewFreeAction(p Permanent, resolveProto ActionFuncPrototype, costFunc ActionCostFunc, desc string, ) *FreeAction { -- cgit v1.2.3