use hecs::Entity;
#[derive(Default)]
pub struct FocusManager{
current_focus_index: Option<usize>,
current_focus_entity: Option<Entity>
}
impl FocusManager{
pub(crate) fn current_focus_index(&self) -> Option<usize>{
self.current_focus_index?;
Some(self.current_focus_index.unwrap())
}
pub(crate) fn current_focus_entity(&self) -> Option<Entity>{
self.current_focus_entity?;
Some(self.current_focus_entity.unwrap())
}
pub(crate) fn change_focus(&mut self, entity: Entity, rank: usize){
self.current_focus_index = Some(rank);
self.current_focus_entity = Some(entity);
}
pub(crate) fn reset_focus(&mut self){
self.current_focus_index = None;
}
}