zunivers_rs/model/
vortex.rs

1use chrono::{NaiveDate, NaiveDateTime};
2use serde::Deserialize;
3
4use crate::model::pack::Pack;
5use crate::model::user::User;
6
7#[derive(Debug, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct VortexSeason {
10    pub id: String,
11    pub index: u16,
12    pub begin_date: NaiveDate,
13    pub end_date: NaiveDate,
14    pub tower: Tower
15}
16
17#[derive(Debug, Deserialize)]
18#[serde(rename_all = "camelCase")]
19pub struct Tower {
20    pub id: String,
21    pub name: String,
22    pub index: u16,
23    pub image_url: String,
24    pub pack: Pack,
25    pub reputation: Reputation,
26    pub tower_floors: Vec<TowerFloor>
27}
28
29#[derive(Debug, Deserialize)]
30pub struct Reputation {
31    pub id: String,
32    pub name: String
33}
34
35#[derive(Debug, Deserialize)]
36#[serde(rename_all = "camelCase")]
37pub struct TowerFloor {
38    pub id: String,
39    pub index: u16,
40    pub rate: f32,
41    pub drop_rates: Vec<DropRate>
42}
43
44#[derive(Debug, Deserialize)]
45#[serde(rename_all = "camelCase")]
46pub struct DropRate {
47    pub id: String,
48    pub is_golden: bool,
49    pub rarity: u16,
50    pub rate: f32
51}
52
53#[derive(Debug, Deserialize)]
54#[serde(rename_all = "camelCase")]
55pub struct Tournament {
56    pub id: String,
57    pub is_done: bool,
58    pub date: NaiveDateTime,
59    pub next_round_date: Option<NaiveDateTime>,
60    pub round_count: u16,
61    pub round_index: u16,
62    pub battles: Vec<Battle>
63}
64
65#[derive(Debug, Deserialize)]
66#[serde(rename_all = "camelCase")]
67pub struct Battle {
68    pub id: String,
69    pub index: u16,
70    pub round_index: u16,
71    pub outcome: Option<bool>,
72    pub participant1: BattlePlayer,
73    pub participant2: Option<BattlePlayer>
74}
75
76#[derive(Debug, Deserialize)]
77#[serde(rename_all = "camelCase")]
78pub struct BattlePlayer {
79    pub id: String,
80    pub bonus: f32,
81    pub user: User
82}