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
if opponent_map {
map_widget = map_widget.add_colored_cells(ColoredCells {
color: match self.game.can_fire_at_location(self.curr_shoot_position) {
true => Color::Green,
false => Color::LightYellow,
color: match (
self.game.can_fire_at_location(self.curr_shoot_position),
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],
});