Files
ojrc/rc_services_room/src/data/player_robopass_season.rs
T

26 lines
916 B
Rust
Raw Normal View History

2025-03-01 16:22:57 -05:00
use polariton::operation::{Typed, Dict};
2025-03-08 17:16:02 -05:00
use polariton::serdes::TypePrefix;
2025-03-01 16:22:57 -05:00
pub struct PlayerRoboPassSeasonInfo {
pub delta_xp_to_show: i32,
pub grade: i32,
pub has_deluxe: bool,
pub progress_in_grade: f32,
pub xp_from_start: i32,
}
impl PlayerRoboPassSeasonInfo {
pub fn as_transmissible(&self) -> Typed {
Typed::Dict(Dict {
2025-03-08 17:16:02 -05:00
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
2025-03-01 16:22:57 -05:00
items: vec![
(Typed::Str("deltaXpToShow".into()), Typed::Int(self.delta_xp_to_show)),
(Typed::Str("grade".into()), Typed::Int(self.grade)),
2025-09-03 22:33:26 -04:00
(Typed::Str("hasDeluxe".into()), Typed::Bool(self.has_deluxe)),
2025-03-01 16:22:57 -05:00
(Typed::Str("progressInGrade".into()), Typed::Float(self.progress_in_grade)),
(Typed::Str("xpFromSeasonStart".into()), Typed::Int(self.xp_from_start)),
],
})
}
}