Files
ojrc/rc_services_room/src/operations/building_xp_config.rs
T

21 lines
955 B
Rust
Raw Normal View History

2025-03-01 16:22:57 -05:00
use polariton_server::operations::SimpleFunc;
2025-03-08 17:16:02 -05:00
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
2025-03-01 16:22:57 -05:00
const PARAM_KEY: u8 = 79;
pub(super) fn building_xp_config_provider() -> SimpleFunc<199, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
2025-03-08 17:16:02 -05:00
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
2025-03-01 16:22:57 -05:00
items: vec![
(Typed::Str("BuildXPSettings".into()), Typed::HashMap(vec![
(Typed::Str("buildModePeriodUserEarnXP".into()), Typed::Float(1.0)), // TODO what are the time units?
(Typed::Str("buildModePeriodUserInactivity".into()), Typed::Float(2.0)),
].into())),
],
}));
Ok(params.into())
})
}