generated from GarandPLG/rust-flake-template
Introduce Ore structure and simplify durability fields
Add a new Ore structure with ownership, amount, and durability, and extend the Structures enum to include it. Update board generation to place ore cells next to player and enemy bases and adjust base coordinates accordingly. Remove the redundant `max_durability` field from BaseBuilding, Stone, and Tunnel, fixing their `get_max_durability` implementations to return constant values. Rename the tick handling parameter from `interval_ms` to `tick_ms`. Minor clean‑ups include re‑exporting the Ore module, adding TODO comments in the side panel widget, and simplifying the audio thread spawn in `main.rs`.
This commit is contained in:
@@ -68,6 +68,7 @@ impl<'a> SidePanelWidget<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Relocate this to Structure trait implementations
|
||||
fn structure_text(&self) -> Vec<Line<'_>> {
|
||||
let s: &Structures = self.structure;
|
||||
let durability: u16 = s.get_durability();
|
||||
@@ -99,6 +100,7 @@ impl<'a> SidePanelWidget<'a> {
|
||||
lines
|
||||
}
|
||||
|
||||
// TODO: Relocate this to Unit trait implementations
|
||||
fn unit_text(&self) -> Vec<Line<'_>> {
|
||||
let u: &Option<Units> = self.unit;
|
||||
let owner: Span<'_> = u.get_owner().get_span();
|
||||
|
||||
Reference in New Issue
Block a user