Refactor task handling to use VecDeque references

- Change `get_tasks` to return `&VecDeque<Tasks>` instead of a formatted
  `String`.
- Introduce `get_tasks_formatted` for display purposes.
- Update `MinerUnit`, `Unit` trait, `Units` enum, and its `Option`
  implementation accordingly.
- Add `EMPTY_TASKS` lazy static for handling empty task lists.
- Adjust `BoardState` to use the new task API (commented out
  conditional).
This commit is contained in:
2026-05-18 14:48:07 +02:00
parent e4728aab5d
commit 7c9e3d28f0
4 changed files with 30 additions and 6 deletions
@@ -57,7 +57,11 @@ impl Unit for MinerUnit {
self.coords
}
fn get_tasks(&self) -> String {
fn get_tasks(&self) -> &VecDeque<Tasks> {
&self.tasks
}
fn get_tasks_formatted(&self) -> String {
format!("{:?}", self.tasks)
}