Implement Team display in perround overview
Now tracks the scores of the teams and displays them on the homepage. Also now displays the team numbers next to the overview of rounds won to know which team won which round
This commit is contained in:
73
common/src/demo_analysis.rs
Normal file
73
common/src/demo_analysis.rs
Normal file
@@ -0,0 +1,73 @@
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ScoreBoard {
|
||||
pub teams: Vec<(u32, Vec<ScoreBoardPlayer>)>
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct ScoreBoardPlayer {
|
||||
pub name: String,
|
||||
pub kills: usize,
|
||||
pub deaths: usize,
|
||||
pub damage: usize,
|
||||
pub assists: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PlayerHeatmap {
|
||||
pub name: String,
|
||||
pub team: String,
|
||||
pub png_data: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PerRoundResult {
|
||||
pub teams: Vec<PerRoundTeam>,
|
||||
pub rounds: Vec<DemoRound>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PerRoundTeam {
|
||||
pub name: String,
|
||||
pub number: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct DemoRound {
|
||||
pub reason: RoundWinReason,
|
||||
pub events: Vec<RoundEvent>
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub enum RoundWinReason {
|
||||
StillInProgress,
|
||||
BombExploded,
|
||||
VipEscaped,
|
||||
VipKilled,
|
||||
TSaved,
|
||||
CtStoppedEscape,
|
||||
RoundEndReasonTerroristsStopped,
|
||||
BombDefused,
|
||||
TKilled,
|
||||
CTKilled,
|
||||
Draw,
|
||||
HostageRescued,
|
||||
TimeRanOut,
|
||||
RoundEndReasonHostagesNotRescued,
|
||||
TerroristsNotEscaped,
|
||||
VipNotEscaped,
|
||||
GameStart,
|
||||
TSurrender,
|
||||
CTSurrender,
|
||||
TPlanted,
|
||||
CTReachedHostage,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub enum RoundEvent {
|
||||
BombPlanted,
|
||||
BombDefused,
|
||||
Killed {
|
||||
attacker: String,
|
||||
died: String,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user