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:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user