2025-05-18 20:33:29 -04:00
|
|
|
pub(self) mod parser;
|
|
|
|
|
|
|
|
|
|
mod weapon_list;
|
|
|
|
|
pub use weapon_list::WeaponListParser;
|
|
|
|
|
|
2025-07-20 21:24:43 -04:00
|
|
|
mod cpu_count;
|
|
|
|
|
pub use cpu_count::CpuListParser;
|
|
|
|
|
|
2025-05-18 20:33:29 -04:00
|
|
|
pub struct CubeParsers {
|
|
|
|
|
weapon_list: std::sync::Arc<WeaponListParser>,
|
2025-07-20 21:24:43 -04:00
|
|
|
cpu_counter: std::sync::Arc<CpuListParser>,
|
2025-05-18 20:33:29 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl CubeParsers {
|
|
|
|
|
pub fn new(conf: &crate::ConfigImpl) -> Self {
|
2025-07-20 21:24:43 -04:00
|
|
|
let cubes = <crate::ConfigImpl as crate::ConfigProvider<()>>::cubes(conf);
|
2025-05-18 20:33:29 -04:00
|
|
|
Self {
|
2025-07-20 21:24:43 -04:00
|
|
|
weapon_list: std::sync::Arc::new(WeaponListParser::with_cubes(cubes.values())),
|
|
|
|
|
cpu_counter: std::sync::Arc::new(CpuListParser::with_cubes(cubes.values())),
|
2025-05-18 20:33:29 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn weapon_order(&self) -> std::sync::Arc<WeaponListParser> {
|
|
|
|
|
self.weapon_list.clone()
|
|
|
|
|
}
|
2025-07-20 21:24:43 -04:00
|
|
|
|
|
|
|
|
pub fn cpu_counter(&self) -> std::sync::Arc<CpuListParser> {
|
|
|
|
|
self.cpu_counter.clone()
|
|
|
|
|
}
|
2025-05-18 20:33:29 -04:00
|
|
|
}
|