yasuki_core.engine.rules.decisions.ChoosePayment#
- class ChoosePayment(seat, candidates, amount, available, produced, label, boostable=())[source]#
The seat must cover a gold cost, bowing gold producers to make up what its pool lacks. The candidates are the seat’s unbowed producers; choosing some bows them, and their production plus the pool must reach the cost. Excess stays in the pool.
The request snapshots everything
accepts()needs, so validity is structural: the cost, the pool on hand when the cost arose, and each producer’s yield.- Attributes:
- amount
int The gold cost to cover.
- available
int The gold already in the seat’s pool when the cost arose.
- produced
tupleof (str,int) Each candidate producer paired with the gold it yields when bowed.
- label
str What the payment is for (e.g. the recruited card’s name), shown in the prompt.
- boostable
tupleof (str,int) Each producer that may raise its yield as it bows, paired with the extra gold its boost adds. The seat opts in per producer via the answer’s
boosted; a boosted producer counts its extra toward the cost and is destroyed after bowing.
- amount
Methods
ChoosePayment.__init__(seat, candidates, ...)ChoosePayment.accepts(response)Return whether
responseis a structurally well-formed answer to this request — the right shape, drawn fromcandidates.Attributes
amountavailableproducedlabelboostablecancellableA Recruit's payment can be backed out of: nothing is committed until it is answered.