Files
RustyPropagation/src/human.rs
T
2022-05-03 13:01:26 +02:00

33 lines
633 B
Rust

// use crate::prelude::*;
// #[derive(Copy, Clone, PartialEq)]
#[derive(PartialEq)]
pub enum State {
Normal,
Infected,
Dead,
Immune,
}
// #[derive(Clone)]
pub struct Human {
pub present_state : State,
pub x : i32,
pub y : i32,
}
impl Human{
// humans with state "Normal"
pub fn new(pos_x :i32, pos_y :i32) -> Self{
Self{
present_state : State::Normal,
x : pos_x,
y : pos_y
}
}
// pub fn new_empty() -> Self{
// Self{
// present_state:State::Normal,
// x : 0,
// y : 0,
// }
// }
}