Add ore level support and unify text rendering

Introduce a numeric `level` field for `BaseBuilding` and `Ore`, update
their
constructors and `get_level` implementations, and increase the default
ore
amount to the new maximum. Extend the `Structure` and `Unit` traits with
`base_text` and `text` methods, add `is_unit` to `Units`, and adjust the
`Structures` enum to delegate text rendering. Refactor `SidePanelWidget`
to
use the unified trait methods, removing duplicated rendering code.
Update
`BoardState` to create ore structures with an initial level of 1.
This commit is contained in:
2026-05-05 00:18:49 +02:00
parent 766b65b2fc
commit 55a260755c
8 changed files with 115 additions and 58 deletions
+2 -2
View File
@@ -81,9 +81,9 @@ impl BoardState {
} else if enemy_base {
Structures::Base(BaseBuilding::new(Players::Enemy))
} else if player_ore {
Structures::Ore(Ore::new(Players::Player))
Structures::Ore(Ore::new(Players::Player, 1))
} else if enemy_ore {
Structures::Ore(Ore::new(Players::Enemy))
Structures::Ore(Ore::new(Players::Enemy, 1))
} else {
Structures::Stone(Stone::new())
};