generated from GarandPLG/rust-flake-template
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user