Add MovingTask and progress tracking

Introduce a new MovingTask type for movement segments and extend
the Tasks enum
to include it.  Add total‑step tracking and a get_total_progress default
in the
Task trait, and implement the corresponding methods for MovingTask.
Update
units to allow coordinate changes via set_coords, add stone damage
handling,
and adjust board advancement logic to use the new task system.  Update
UI
code to display step and total percentages in the Tab panel.  Expand
documentation (README, AGENTS, CODE_MAP, PROGRESS, TESTING) to describe
digging
and moving, and add extensive tests (including tests/digging.rs) for the
new
behaviour.
This commit is contained in:
GarandPLG committed 2026-10-18 21:21:00 +02:00
1 parent fcdbbaf74c
commit 9e09aaf75e
21 files changed
+1049 -144

No files matched your search

@@ -60,6 +60,10 @@ impl Unit for Units {
self.u().get_coords()
}
fn set_coords(&mut self, coords: (usize, usize)) {
self.u_mut().set_coords(coords);
}
fn get_ref_tasks(&self) -> &VecDeque<Tasks> {
self.u().get_ref_tasks()
}
@@ -114,6 +118,12 @@ impl Unit for Option<Units> {
self.as_ref().map_or((0, 0), |u| u.get_coords())
}
fn set_coords(&mut self, coords: (usize, usize)) {
if let Some(unit) = self.as_mut() {
unit.set_coords(coords);
}
}
fn get_ref_tasks(&self) -> &VecDeque<Tasks> {
self.as_ref()
.expect("attempted to get referenced tasks from `None`")