Files
ojrc/rc_core/src/cubes/mod.rs
T

31 lines
838 B
Rust

pub(self) mod parser;
mod weapon_list;
pub use weapon_list::WeaponListParser;
mod cpu_count;
pub use cpu_count::CpuListParser;
pub struct CubeParsers {
weapon_list: std::sync::Arc<WeaponListParser>,
cpu_counter: std::sync::Arc<CpuListParser>,
}
impl CubeParsers {
pub fn new(conf: &crate::ConfigImpl) -> Self {
let cubes = <crate::ConfigImpl as crate::ConfigProvider<()>>::cubes(conf);
Self {
weapon_list: std::sync::Arc::new(WeaponListParser::with_cubes(cubes.values())),
cpu_counter: std::sync::Arc::new(CpuListParser::with_cubes(cubes.values())),
}
}
pub fn weapon_order(&self) -> std::sync::Arc<WeaponListParser> {
self.weapon_list.clone()
}
pub fn cpu_counter(&self) -> std::sync::Arc<CpuListParser> {
self.cpu_counter.clone()
}
}