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
+3
View File
@@ -219,11 +219,14 @@ impl BoardState {
}
let (row, col) = self.marked_cells.selected_unit.get_coords();
// if !self.marked_cells.marked_cells.len() == 1 {
let task: Tasks = Tasks::Digging(DiggingTask::new(self.marked_cells.marked_cells.clone()));
self.get_mut_cell(row, col)
.get_mut_option_unit()
.set_task(task);
// }
self.marked_cells.selected_unit = None;
self.marked_cells.marked_cells.clear();