Show unit task queue and mark in side panel

Add `get_tasks` to the `Unit` trait and implement it for `MinerUnit`,
`Units` enum and `Option<Units>`.  Use the new method in `base_text` to
display a “Tasks Queue” line.

Refactor task assignment in `BoardState` to a chained call.

Update the skirmish view and `SidePanelWidget` to pass a flag indicating
whether the displayed unit is the currently marked one, and highlight
the
unit name accordingly.
This commit is contained in:
GarandPLG committed 2026-05-17 11:00:06 +02:00
1 parent a7d8823bf2
commit e4728aab5d
6 files changed
+41 -5

No files matched your search

@@ -58,6 +58,10 @@ impl Unit for Units {
self.u().get_coords()
}
fn get_tasks(&self) -> String {
self.u().get_tasks()
}
fn set_task(&mut self, task: Tasks) {
self.u_mut().set_task(task);
}
@@ -100,6 +104,10 @@ impl Unit for Option<Units> {
self.as_ref().map_or((0, 0), |u| u.get_coords())
}
fn get_tasks(&self) -> String {
self.as_ref().map_or("".to_string(), |u| u.get_tasks())
}
fn set_task(&mut self, task: Tasks) {
self.as_mut().map_or((), |u| u.set_task(task))
}