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:
amountint

The gold cost to cover.

availableint

The gold already in the seat’s pool when the cost arose.

producedtuple of (str, int)

Each candidate producer paired with the gold it yields when bowed.

labelstr

What the payment is for (e.g. the recruited card’s name), shown in the prompt.

boostabletuple of (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.

Methods

ChoosePayment.__init__(seat, candidates, ...)

ChoosePayment.accepts(response)

Return whether response is a structurally well-formed answer to this request — the right shape, drawn from candidates.

Attributes

amount

available

produced

label

boostable

cancellable

A Recruit's payment can be backed out of: nothing is committed until it is answered.