use crate::binding::ActionMap;
use std::collections::HashMap;
pub type LayoutId = Option<&'static str>;
pub type ActionSetId = Option<&'static str>;
#[derive(Debug, Clone)]
pub struct ActionSet(HashMap<LayoutId, ActionMap>);
impl Default for ActionSet {
fn default() -> Self {
Self(HashMap::new())
}
}
impl ActionSet {
pub fn with(mut self, layout: LayoutId, map: ActionMap) -> Self {
self.0.insert(layout, map);
self
}
pub(crate) fn get(&self, layout: &LayoutId) -> Option<&ActionMap> {
self.0.get(layout)
}
}