use crate::game::MAXIMUM_SIDE;
use crate::game::MINIMUM_SIDE;
use thiserror::Error;
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
#[non_exhaustive]
pub enum GameError {
#[error("column {column} does not exist, the board has {column_count} columns")]
ColumnOutOfRange { column: usize, column_count: usize },
#[error("column {column} is full")]
ColumnFull { column: usize },
#[error("the game is already over")]
GameOver,
#[error(
"a board must have between {MINIMUM_SIDE} and {MAXIMUM_SIDE} columns and rows, \
got {column_count} columns and {row_count} rows"
)]
InvalidDimensions {
column_count: usize,
row_count: usize,
},
#[error("the board rejected a valid move: {reason}")]
Board { reason: String },
}