ritchie/engine/reaction_check

Validation of reactions by out-of-turn players.

Types

The validated side effects of a reaction, for the engine to cache until the turn is resolved.

pub type ValidatedReaction {
  ValidatedReaction(
    meld: option.Option(meld.Meld),
    ron: List(agari.AgariInput),
  )
}

Constructors

  • ValidatedReaction(
      meld: option.Option(meld.Meld),
      ron: List(agari.AgariInput),
    )

    Arguments

    meld

    The meld declared by a chii, pon, or daiminkan.

    ron

    Every winning interpretation found for a ron.

Values

pub fn check_reaction(
  begin: boundary.RoundBegin,
  state: state.State,
  act: action.Action,
  reactor: player.Player,
  reaction: reaction.Reaction,
) -> Result(ValidatedReaction, error.ReactionError)

Validates reaction by reactor against act and the current state.

✨ Search Document