ritchie/engine/action_check
Validation of actions by the in-turn player.
Types
The validated side effects of an action, for the engine to cache until the turn is resolved.
pub type ValidatedAction {
ValidatedAction(
meld: option.Option(meld.Meld),
tsumo: List(agari.AgariInput),
)
}
Constructors
-
ValidatedAction( meld: option.Option(meld.Meld), tsumo: List(agari.AgariInput), )Arguments
- meld
-
The meld declared by an ankan or kakan.
- tsumo
-
Every winning interpretation found for a tsumo.
Values
pub fn check_action(
begin: boundary.RoundBegin,
state: state.State,
act: action.Action,
) -> Result(ValidatedAction, error.ActionError)
Validates act against the current state and returns the side effects the
engine needs to carry into the next step.