use std::fmt;
#[derive(Debug, Clone)]
pub struct IllegalAbilityException {
pub message: String,
}
impl IllegalAbilityException {
pub fn new(message: impl Into<String>) -> Self {
Self {
message: message.into(),
}
}
pub fn with_effect(sa_desc: &str, effect_name: &str) -> Self {
Self {
message: format!("{} (effect {})", sa_desc, effect_name),
}
}
}
impl fmt::Display for IllegalAbilityException {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "IllegalAbilityException: {}", self.message)
}
}
impl std::error::Error for IllegalAbilityException {}