Improve colors

This commit is contained in:
Pierre HUBERT 2022-10-15 16:11:30 +02:00
parent 3455559d33
commit 4341bdc682

View File

@ -225,9 +225,16 @@ impl GameScreen {
// Current shoot position // Current shoot position
if opponent_map { if opponent_map {
map_widget = map_widget.add_colored_cells(ColoredCells { map_widget = map_widget.add_colored_cells(ColoredCells {
color: match self.game.can_fire_at_location(self.curr_shoot_position) { color: match (
true => Color::Green, self.game.can_fire_at_location(self.curr_shoot_position),
false => Color::LightYellow, self.game
.opponent_map
.successful_strikes
.contains(&self.curr_shoot_position),
) {
(true, _) => Color::Green,
(false, false) => Color::LightYellow,
(false, true) => Color::LightRed,
}, },
cells: vec![self.curr_shoot_position], cells: vec![self.curr_shoot_position],
}); });