diff --git a/src/dynamic_data/flow/choice_queue.rs b/src/dynamic_data/flow/choice_queue.rs index fcbcb1f..f262b6b 100644 --- a/src/dynamic_data/flow/choice_queue.rs +++ b/src/dynamic_data/flow/choice_queue.rs @@ -50,7 +50,7 @@ impl ChoiceQueue { } /// This moves the choice of a specific Pokemon up to the next choice to be executed. - pub fn move_pokemon_choice_next(&mut self, pokemon: &Pokemon) { + pub fn move_pokemon_choice_next(&mut self, pokemon: &Pokemon) -> bool { let mut desired_index = None; // Find the index for the choice we want to move up. for index in self.current..self.queue.len() { @@ -63,12 +63,12 @@ impl ChoiceQueue { } // If we couldn't find a choice, we can't execute, return. if desired_index.is_none() { - return; + return false; } let desired_index = desired_index.unwrap(); // If the choice we want to move up is already the next choice, just return. if desired_index == self.current { - return; + return true; } // Take the choice we want to move forward out of it's place. @@ -80,6 +80,7 @@ impl ChoiceQueue { } // Place the choice that needs to be next in the next to be executed position. let _ = self.queue[self.current].insert(choice); + true } /// Internal helper function to be easily able to iterate over the yet to be executed choices.