1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00
Files
ojrc/rc_services_room/src/operations/tech_points.rs
2025-03-01 16:22:57 -05:00

23 lines
845 B
Rust

use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
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();
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())
})
}