Implement Movement Cost
This commit is contained in:
parent
e03cd06c78
commit
9fbce6b320
1 changed files with 34 additions and 6 deletions
|
@ -117,22 +117,50 @@ impl Tile {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn can_stand_inside(&self) -> bool {
|
pub fn can_stand_inside(&self) -> bool {
|
||||||
unimplemented!()
|
#[allow(clippy::match_like_matches_macro)] // I believe this is better readable
|
||||||
|
match self {
|
||||||
|
Self::House { door: false, .. } => false,
|
||||||
|
_ => true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn movement_cost_left(&self) -> MovementCost {
|
pub fn movement_cost_left(&self) -> MovementCost {
|
||||||
unimplemented!()
|
match self {
|
||||||
|
Self::Grass => MovementCost::Default,
|
||||||
|
Self::Path { left: true, .. } => MovementCost::Path,
|
||||||
|
Self::Fence { left: false, .. } => MovementCost::Obstacle,
|
||||||
|
_ => MovementCost::Infinite
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn movement_cost_right(&self) -> MovementCost {
|
pub fn movement_cost_right(&self) -> MovementCost {
|
||||||
unimplemented!()
|
match self {
|
||||||
|
Self::Grass => MovementCost::Default,
|
||||||
|
Self::Path { right: true, .. } => MovementCost::Path,
|
||||||
|
Self::Fence { right: false, .. } => MovementCost::Obstacle,
|
||||||
|
_ => MovementCost::Infinite
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn movement_cost_up(&self) -> MovementCost {
|
pub fn movement_cost_up(&self) -> MovementCost {
|
||||||
unimplemented!()
|
match self {
|
||||||
|
Self::Grass => MovementCost::Default,
|
||||||
|
Self::Path { top: true, .. } => MovementCost::Path,
|
||||||
|
Self::Fence { top: false, .. } => MovementCost::Obstacle,
|
||||||
|
_ => MovementCost::Infinite
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn movement_cost_down(&self) -> MovementCost {
|
pub fn movement_cost_down(&self) -> MovementCost {
|
||||||
unimplemented!()
|
match self {
|
||||||
|
Self::Grass => MovementCost::Default,
|
||||||
|
Self::Path { bottom: true, .. } => MovementCost::Path,
|
||||||
|
Self::Fence { bottom: false, .. } => MovementCost::Obstacle,
|
||||||
|
_ => MovementCost::Infinite
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn can_enter_house(&self) -> bool {
|
pub fn can_enter_house(&self) -> bool {
|
||||||
unimplemented!()
|
#[allow(clippy::match_like_matches_macro)] // I believe this is better readable
|
||||||
|
match self {
|
||||||
|
Self::House { door: true, .. } => true,
|
||||||
|
_ => false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue