scion 0.7.0

Game making library on top of wgpu, winit, hecs
Documentation
use hecs::Entity;

/// `FocusManager` is the resource that will handle the cycle of focus with tab
/// coupled to the focus systems
#[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;
    }
}