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:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user