2022-06-11 15:22:46 +00:00
|
|
|
use crate::dynamic_data::models::pokemon::Pokemon;
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
2022-06-03 14:35:18 +00:00
|
|
|
#[derive(Debug)]
|
2022-06-11 15:22:46 +00:00
|
|
|
pub struct ChoiceQueue {
|
|
|
|
queue: Vec<Arc<ChoiceQueue>>,
|
|
|
|
current: usize,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ChoiceQueue {
|
|
|
|
pub fn new(queue: Vec<Arc<ChoiceQueue>>) -> Self {
|
|
|
|
Self { queue, current: 0 }
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn dequeue(&mut self) -> &Arc<ChoiceQueue> {
|
|
|
|
let c = &self.queue[self.current];
|
|
|
|
self.current += 1;
|
|
|
|
c
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn peek(&mut self) -> &Arc<ChoiceQueue> {
|
|
|
|
&self.queue[self.current]
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn has_next(&self) -> bool {
|
|
|
|
self.current < self.queue.len()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn move_pokemon_choice_next(&mut self, _pokemon: &Pokemon) {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|