veloren/common/src/effect.rs
Monty Marz fdfab6a807 refactor: create_projectile doesn't take a light
It returns a builder so the caller can just do it
2019-10-17 20:59:36 +00:00

18 lines
414 B
Rust

use crate::comp;
/// An effect that may be applied to an entity
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Effect {
Health(comp::HealthChange),
Xp(i64),
}
impl Effect {
pub fn info(&self) -> String {
match self {
Effect::Health(c) => format!("{:+} health", c.amount),
Effect::Xp(n) => format!("{:+} exp", n),
}
}
}