Add Stone and Tunnel, refactor CellStructure

Introduce new building types Stone and Tunnel with their own tag, color,
and
properties. CellStructure now holds these structs (Tunnel, Stone)
instead of
simple variants. BaseBuilding is simplified to return a char tag and a
color
based on owner. BoardState creation and CellWidget rendering are updated
to
use the new building structs and their methods.
This commit is contained in:
GarandPLG committed 2026-04-19 20:00:59 +02:00
1 parent 54e86b2688
commit 33088dc29d
8 files changed
+119 -46

No files matched your search

+6 -2
View File
@@ -2,7 +2,11 @@ use crate::app::{
helpers::{CellSizes, cell_size_helper, cells_area_helper},
states::{
CellStructure, FocusedCell, Offset, Players, Units, ZoomLevel,
skirmish_states::{MoveFocusedCell, buildings::BaseBuilding, units::MinerUnit},
skirmish_states::{
MoveFocusedCell,
buildings::{BaseBuilding, Stone},
units::MinerUnit,
},
},
widgets::CellWidget,
};
@@ -68,7 +72,7 @@ impl BoardState {
} else if enemy_base {
CellStructure::Base(BaseBuilding::new(Players::Enemy))
} else {
CellStructure::Stone
CellStructure::Stone(Stone::new())
};
let unit: Option<Units> = if player_base {