generated from GarandPLG/rust-flake-template
Add max durability and enhance side panel UI
- Introduce `max_durability` fields to BaseBuilding, Stone, and Tunnel structures. - Extend `Structure` trait with `get_max_durability` and implement it in all structures. - Update `Structures` enum to forward `get_max_durability`. - Add color utilities and `get_span` method to `Players` enum for styled text. - Refactor `CellWidget` method names (`get_option_unit`, `set_structure`). - Revise side panel widget to accept references to `Structures` and `Option<Units>`, render colored blocks and detailed stats. - Simplify skirmish view to use `BoardState` directly and adapt side panel rendering.
This commit is contained in:
1 parent
c24862dd48
commit
f7c1795f29
9 files changed
+165
-62
No files matched your search
@@ -56,12 +56,12 @@ impl CellWidget {
|
||||
self.structure
|
||||
}
|
||||
|
||||
pub fn get_unit_option(&self) -> Option<Units> {
|
||||
pub fn get_option_unit(&self) -> Option<Units> {
|
||||
self.unit
|
||||
}
|
||||
|
||||
pub fn set_structure(&mut self, sctructure: Structures) -> &mut Self {
|
||||
self.structure = sctructure;
|
||||
pub fn set_structure(&mut self, structure: Structures) -> &mut Self {
|
||||
self.structure = structure;
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user