Many fixes:
- comment out dead code - reduce number of casting - fix loop block
This commit is contained in:
+18
-17
@@ -1,31 +1,32 @@
|
||||
use crate::prelude::*;
|
||||
// use crate::prelude::*;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
// #[derive(Copy, Clone, PartialEq)]
|
||||
#[derive(PartialEq)]
|
||||
pub enum State {
|
||||
Normal,
|
||||
Infected,
|
||||
Dead,
|
||||
Immune,
|
||||
}
|
||||
#[derive(Clone,Copy)]
|
||||
// #[derive(Clone)]
|
||||
pub struct Human {
|
||||
pub present_state : State,
|
||||
pub x : i32,
|
||||
pub y : i32,
|
||||
}
|
||||
impl Human{
|
||||
pub fn new(state : State, pos_x :i32, pos_y :i32) -> Self{
|
||||
Self{
|
||||
present_state : state,
|
||||
x : pos_x,
|
||||
y : pos_y
|
||||
}
|
||||
}
|
||||
pub fn new_empty() -> Self{
|
||||
Self{
|
||||
present_state:State::Normal,
|
||||
x : 0,
|
||||
y : 0,
|
||||
}
|
||||
}
|
||||
// pub fn new(state : State, pos_x :i32, pos_y :i32) -> Self{
|
||||
// Self{
|
||||
// present_state : state,
|
||||
// x : pos_x,
|
||||
// y : pos_y
|
||||
// }
|
||||
// }
|
||||
// pub fn new_empty() -> Self{
|
||||
// Self{
|
||||
// present_state:State::Normal,
|
||||
// x : 0,
|
||||
// y : 0,
|
||||
// }
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user