Commit Graph

4 Commits

Author SHA1 Message Date
GarandPLG d2f5968861 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.
2026-05-18 15:48:40 +02:00
GarandPLG b66c1d8e25 Use VecDeque for tasks and marked cells
Replace `Vec` with `VecDeque` in `BoardState` marked cells,
`DiggingTask` path,
and `MinerUnit` tasks to enable efficient push/pop operations. Remove
the
`Copy` trait from several structs and enums, adjust derives accordingly,
and
use `as_ref` in `Option<Units>` implementations to avoid consuming the
option.
Update cell rendering to clone widgets and adjust
`CellWidget::get_option_unit`
to return a cloned `Option<Units>`. Add necessary `VecDeque` imports.
2026-05-06 20:01:49 +02:00
GarandPLG 644d8648b2 Refactor DiggingTask and embed it in Tasks enum
- Remove lifetime and path storage from DiggingTask, make it Copy.
- Add a placeholder `new` constructor that accepts a path.
- Update the Tasks enum to hold a DiggingTask value.
- Reorder module declarations and re‑export order for tasks.
- Add a commented‑out tasks field to MinerUnit as a preparation step.
2026-05-05 17:43:50 +02:00
GarandPLG 1c0f27f115 Add tasks module and rename trait files 2026-05-05 17:14:33 +02:00