use nalgebra::{Point2, Vector2};
use crate::cell_map::Bounds;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Can't create a Windows iterator since the window size ({0}) is larger than the map size ({1})")]
WindowLargerThanMap(Vector2<usize>, Vector2<usize>),
#[error("Parent-frame position {0} ({1}) is outside the map")]
PositionOutsideMap(String, Point2<f64>),
#[error("The index {0} is outside the map")]
IndexOutsideMap(Point2<usize>),
#[error("Expected {0} layers but found {1}")]
WrongNumberOfLayers(usize, usize),
#[error("Expected {0:?} cells in layer, but found {1:?}")]
LayerWrongShape((usize, usize), (usize, usize)),
#[error("An IO error occured: {0}")]
IoError(std::io::Error),
#[cfg(feature = "json")]
#[error("Error in serde_json: {0}")]
JsonError(serde_json::Error),
#[error("The provided bounds are not valid: {0:?}")]
InvalidBounds(Bounds),
}