mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-21 10:27:01 +02:00
✨ Add more maps, fix the enum
This commit is contained in:
1 parent
1313bc82f7
commit
da0646f40a
8 files changed
+45
-5
No files matched your search
@@ -3,3 +3,4 @@ pub mod battle_results_dat;
|
||||
pub mod data;
|
||||
pub mod map_id;
|
||||
pub mod meta;
|
||||
pub mod room_type;
|
||||
@@ -2,6 +2,7 @@ use prost::bytes::Buf;
|
||||
use prost::{Enumeration, Message};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::models::room_type::RoomType;
|
||||
use crate::result::Result;
|
||||
|
||||
impl BattleResults {
|
||||
@@ -41,6 +42,9 @@ pub struct BattleResults {
|
||||
#[prost(message, required, tag = "8")]
|
||||
pub author: Author,
|
||||
|
||||
#[prost(enumeration = "RoomType", tag = "9")]
|
||||
pub room_type: i32,
|
||||
|
||||
/// Author's free XP, including premium.
|
||||
#[prost(uint32, tag = "137")]
|
||||
pub free_xp: u32,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use prost::Enumeration;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::rust::deserialize_ignore_any;
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Enumeration)]
|
||||
#[derive(Debug, Serialize_repr, Deserialize_repr, Enumeration, Ord, PartialOrd, Eq, PartialEq)]
|
||||
#[serde(untagged)]
|
||||
#[repr(u16)]
|
||||
pub enum MapId {
|
||||
DesertSands = 2,
|
||||
Middleburg = 3,
|
||||
@@ -13,6 +13,7 @@ pub enum MapId {
|
||||
FortDespair = 8,
|
||||
Himmelsdorf = 9,
|
||||
OasisPalms = 11,
|
||||
GhostFactory = 12,
|
||||
Molendijk = 14,
|
||||
PortBay = 15,
|
||||
Castilla = 20,
|
||||
@@ -20,12 +21,14 @@ pub enum MapId {
|
||||
YamatoHarbor = 25,
|
||||
Canyon = 27,
|
||||
MayanRuins = 30,
|
||||
DynastyPearl = 31,
|
||||
NavalFrontier = 35,
|
||||
Alpenstadt = 38,
|
||||
NewBay = 40,
|
||||
Normandy = 42,
|
||||
Wasteland = 71,
|
||||
|
||||
/// Default value for Protocol Buffers and fallback value for Serde.
|
||||
#[serde(deserialize_with = "deserialize_ignore_any")]
|
||||
#[serde(deserialize_with = "serde_with::rust::deserialize_ignore_any")]
|
||||
Undefined = 0,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
use prost::Enumeration;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Enumeration, Serialize, Ord, PartialOrd, Eq, PartialEq)]
|
||||
pub enum RoomType {
|
||||
Any = 0,
|
||||
Regular = 1,
|
||||
TrainingRoom = 2,
|
||||
Tournament = 4,
|
||||
QuickTournament = 5,
|
||||
Rating = 7,
|
||||
MadGames = 8,
|
||||
RealisticBattles = 22,
|
||||
Uprising = 23,
|
||||
GravityMode = 24,
|
||||
Skirmish = 25,
|
||||
BurningGames = 26,
|
||||
}
|
||||
Reference in new issue
Block a user