Files
war-in-tunnels/src/app/states/skirmish_states/structures/structures_trait.rs
T
GarandPLG f7c1795f29 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.
2026-04-26 21:04:19 +02:00

12 lines
300 B
Rust

use ratatui::style::Color;
pub trait Structure {
fn get_tag(&self) -> char;
fn get_color(&self) -> Color;
fn get_level(&self) -> char;
fn get_stress(&self) -> u8;
fn get_durability(&self) -> u16;
fn get_max_durability(&self) -> u16;
fn get_name(&self) -> &'static str;
}