use crate::dynamic_data::choices::TurnChoice; use crate::dynamic_data::models::pokemon::Pokemon; #[derive(Debug)] pub struct ChoiceQueue<'battle, 'library> { queue: Vec>>, current: usize, } impl<'battle, 'library> ChoiceQueue<'battle, 'library> { pub fn new(queue: Vec>>) -> Self { Self { queue, current: 0 } } pub fn dequeue<'b>(&'b mut self) -> TurnChoice<'battle, 'library> { let c = self.queue[self.current].take(); self.current += 1; c.unwrap() } pub fn peek(&mut self) -> &'battle TurnChoice { self.queue[self.current].as_ref().unwrap() } pub fn has_next(&self) -> bool { self.current < self.queue.len() } pub fn move_pokemon_choice_next(&mut self, _pokemon: &Pokemon) { todo!() } pub(crate) fn get_queue(&self) -> &[Option>] { &self.queue[self.current..self.queue.len()] } }