pub mod constants;
use std::collections::VecDeque;
pub use constants::*;
pub struct FlufflEvent{
event_queue:VecDeque<EventKind>
}
impl FlufflEvent{
pub fn new()->Self{
Self{
event_queue:VecDeque::new(),
}
}
pub fn push_event( &mut self, event:EventKind){
self.event_queue.push_back(event);
}
pub fn iter_mut(&mut self)->EventIter{
EventIter{
event:self,
}
}
}
pub struct EventIter<'a>{
event:&'a mut FlufflEvent,
}
impl <'a> Iterator for EventIter<'a>{
type Item = EventKind;
fn next(&mut self) -> Option<Self::Item> {
self.event.event_queue.pop_front()
}
}