generated from GarandPLG/rust-flake-template
Add Task trait and improve miner task display
Define a full `Task` trait with icon and path accessors. Implement the trait for `DiggingTask` and delegate it through the `Tasks` enum. Introduce helper functions in `MinerUnit` to convert coordinates to spreadsheet‑style strings and use them in a revamped `get_tasks_formatted`. Update the unit rendering logic to show the tasks queue only when tasks are present.
This commit is contained in:
@@ -1 +1,11 @@
|
||||
pub trait Task {}
|
||||
use std::collections::VecDeque;
|
||||
|
||||
pub trait Task {
|
||||
fn get_icon(&self) -> char;
|
||||
|
||||
fn get_path(&self) -> &VecDeque<(usize, usize)>;
|
||||
|
||||
fn get_path_front_coords(&self) -> &(usize, usize);
|
||||
|
||||
fn get_path_back_coords(&self) -> &(usize, usize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user