Break: extract TeamNumber

This commit is contained in:
Pavel Perestoronin committed 2022-12-03 18:13:57 +01:00
1 parent 6fb70da06f
commit 68e00c5eca
1 file changed
+15 -2
+15 -2
View File
@@ -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<Player>,
}
#[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<u32>,
#[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,
}