Skip to content

Commit

Permalink
Change display to print robot health instead of a square
Browse files Browse the repository at this point in the history
  • Loading branch information
outkine committed Oct 26, 2020
1 parent d5ee08c commit 3d869ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ pub fn display_state(state: &StateForOutput) {
let obj = state.objs.get(&id).unwrap();
match &obj.1 {
ObjDetails::Terrain(_) => "■".white(),
ObjDetails::Unit(unit) => match unit.team {
Team::Red => "r".white().on_red(),
Team::Blue => "b".white().on_blue(),
ObjDetails::Unit(unit) => {
let health = unit.health.to_string();
match unit.team {
Team::Red => health.red(),
Team::Blue => health.blue()
}
},
}
}
Expand Down

0 comments on commit 3d869ac

Please sign in to comment.