diff --git a/src/models/battle_results.rs b/src/models/battle_results.rs index ae89714..d9c3dd9 100644 --- a/src/models/battle_results.rs +++ b/src/models/battle_results.rs @@ -15,30 +15,43 @@ impl BattleResults { #[derive(Message)] pub struct BattleResults { + /// Battle timestamp. #[prost(int64, tag = "2")] pub timestamp: i64, + /// Players in the battle. #[prost(message, repeated, tag = "201")] pub players: Vec, } #[derive(Message)] pub struct Player { + /// Player's account ID. #[prost(uint32, tag = "1")] pub account_id: u32, + /// Player's extended information. #[prost(message, required, tag = "2")] pub info: PlayerInfo, } #[derive(Message)] pub struct PlayerInfo { + /// Player's nickname. #[prost(string, tag = "1")] pub nickname: String, #[prost(uint32, optional, tag = "2")] pub platoon_id: Option, - #[prost(uint32, tag = "3")] - pub team_number: u32, + /// Player's team assignment. + #[prost(enumeration = "TeamNumber", tag = "3")] + pub team_number: i32, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, prost::Enumeration)] +#[repr(i32)] +pub enum TeamNumber { + One = 1, + Two = 2, }