From 3d869ac87fd0ec70d82831bd05811f8109fcea0c Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 8 Aug 2020 18:51:10 -0500 Subject: [PATCH] Change display to print robot health instead of a square --- src/display.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/display.rs b/src/display.rs index 160979c..47cc64c 100644 --- a/src/display.rs +++ b/src/display.rs @@ -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() + } }, } }