1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pub struct Entity { alive: bool } impl Entity { pub fn new() -> Self { Entity { alive: true } } pub fn is_alive(&self) -> bool { self.alive } pub fn invalid(&mut self) { self.alive = false; } pub fn reset(&mut self) { self.alive = true; } }