Use new() impl for humans
This commit is contained in:
+8
-7
@@ -15,13 +15,14 @@ pub struct Human {
|
||||
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
|
||||
// }
|
||||
// }
|
||||
// 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,
|
||||
|
||||
Reference in New Issue
Block a user