Skip to main content

yahtzee_engine/
action.rs

1//! The one decision a Yahtzee turn ever poses.
2
3use crate::{Category, Keep};
4
5/// What to do with the dice on the table: hold some and reroll the rest,
6/// or write a category now.
7///
8/// Scoring early is always legal; rerolling is legal only while rolls
9/// remain, which the [`Game`](crate::Game) enforces at runtime.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
11pub enum TurnAction {
12    /// Hold exactly these dice and reroll the others.
13    Reroll(Keep),
14    /// End the turn by scoring this category.
15    Score(Category),
16}