generated from GarandPLG/rust-flake-template
Add progress tracking to tasks and turn advancement
- Extend the `Task` trait with methods for progress handling and completion. - Update `DiggingTask` to store `progress` and `tick_increase`, and implement the new trait methods. - Implement the new methods in the `Tasks` enum, adding a mutable accessor. - Introduce `BoardState::get_active_tasks` and `BoardState::advance_turn` to iterate over active tasks and update their progress each turn. - Un-comment the call to `board.advance_turn()` in `SkirmishState::tick_update`.
This commit is contained in:
@@ -11,7 +11,7 @@ pub struct SkirmishState {
|
||||
|
||||
impl SkirmishState {
|
||||
pub fn tick_update(&mut self) {
|
||||
// self.board.advance_turn();
|
||||
self.board.advance_turn();
|
||||
|
||||
// if self.board.is_victory() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user