use thiserror::Error;
#[derive(Error, Debug, PartialEq, Eq, Hash, Clone, Copy, PartialOrd, Ord)]
pub enum GeneratorError {
#[error("Biome id {0} is out of range and is not a valid biomeid")]
BiomeIDOutOfRange(i32),
#[error(
"Function getBiomeAt failed with error code -1, did you forgot to initialize the seed?"
)]
GetBiomeAtFailure,
#[error("Function genBiomes failed with error code {0}")]
GenBiomeToCacheFailure(i32),
#[error("Index out of bounds")]
IndexOutOfBounds,
#[error("Failed to convert range")]
TryFromRangeError(TryFromRangeError),
}
impl From<TryFromRangeError> for GeneratorError {
fn from(value: TryFromRangeError) -> Self {
Self::TryFromRangeError(value)
}
}
#[derive(Error, Debug, PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord)]
pub enum TryFromRangeError {
#[error("x sixe is out of bounds for range")]
#[allow(missing_docs)]
XSizeOutOfBounds,
#[error("z size is out of bounds for range")]
#[allow(missing_docs)]
ZSizeOutOfBounds,
#[error("y size is out of bounds for range")]
#[allow(missing_docs)]
YSizeOutOfBouns,
}