PkmnLib_rs/src/dynamic_data/flow/choice_queue.rs

33 lines
695 B
Rust
Raw Normal View History

use crate::dynamic_data::models::pokemon::Pokemon;
use std::sync::Arc;
2022-06-03 14:35:18 +00:00
#[derive(Debug)]
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!()
}
}