Skip to main content

validate

Function validate 

Source
pub fn validate(
    engine: &GameEngine,
    player: PlayerId,
    action: &Action,
) -> Result<(), CardinalError>
Expand description

Validate that an action is legal in the current game state. Checks:

  • Only the priority player can pass priority
  • Only the active player can take other actions
  • The current phase allows actions
  • Stack requirements are met (if action requires empty stack)
  • Zone ownership and card ownership are valid