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

22 lines
845 B
Rust
Raw Normal View History

use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
2025-03-01 16:22:57 -05:00
const CURRENT_PARAM_KEY: u8 = 214;
pub(super) fn tech_points_provider() -> SimpleFunc<187, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
2025-03-01 16:22:57 -05:00
params.insert(CURRENT_PARAM_KEY, Typed::Int(1337));
Ok(params.into())
})
}
const UNCLAIMED_PARAM_KEY: u8 = 212;
pub(super) fn tech_points_awards_provider() -> SimpleFunc<185, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(UNCLAIMED_PARAM_KEY, Typed::Int(0));
Ok(params.into())
})
}