use hexx::{EdgeDirection, Hex};
use thiserror::Error;
use crate::Tile;
#[derive(Debug, Error, PartialEq, Eq)]
pub enum MazeBuilderError {
#[error("Radius must be specified to build a maze")]
NoRadius,
#[error("Start position {0:?} is outside maze bounds")]
InvalidStartPosition(Hex),
#[error("Failed to generate maze: {0}")]
GenerationError(String),
}
#[derive(Debug, Error, PartialEq, Eq)]
pub enum MazeError {
#[error("Invalid coordinate: {0:?}")]
InvalidCoordinate(Hex),
#[error("Tile position ({tile_pos:?}) does not match insertion coordinates ({insert_pos:?})")]
PositionMismatch { tile_pos: Hex, insert_pos: Hex },
#[error("A tile {old_tile:?} already exists at position {pos:?}")]
TileAlreadyExists { pos: Hex, old_tile: Tile },
#[error("Cannot add wall at {coord:?} in direction {direction:?}")]
WallOperationFailed {
coord: Hex,
direction: EdgeDirection,
},
}