1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Fix CPU number calculation and display in lots of places

This commit is contained in:
NG (Graham)
2025-07-20 21:24:43 -04:00
parent 37cbc8d85f
commit 4e9bcc36d6
11 changed files with 139 additions and 43 deletions

View File

@@ -3,18 +3,28 @@ 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(<crate::ConfigImpl as crate::ConfigProvider<()>>::cubes(conf).values())),
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()
}
}