use crate::model::{
BombRoundState, GameState, MapPhase, MatchStats, Player, PlayerActivity, PlayerTeam, Provider,
RoundPhase, WinningTeam,
};
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerUpdated {
pub player: Player,
pub previous: Option<Player>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerDied {
pub player: Player,
pub previous_health: i32,
pub new_health: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerRespawned {
pub player: Player,
pub previous_health: i32,
pub new_health: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerTookDamage {
pub player: Player,
pub previous_health: i32,
pub new_health: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerGotKill {
pub player: Player,
pub previous_round_kills: i32,
pub new_round_kills: i32,
pub is_headshot: bool,
pub weapon: Option<String>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerHealthChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerArmorChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerHelmetChanged {
pub player: Player,
pub previous: bool,
pub new: bool,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerFlashAmountChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerSmokedAmountChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerBurningAmountChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerMoneyAmountChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerEquipmentValueChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerRoundKillsChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerRoundHeadshotKillsChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerRoundTotalDamageChanged {
pub player: Player,
pub previous: i32,
pub new: i32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerActivityChanged {
pub player: Player,
pub previous: PlayerActivity,
pub new: PlayerActivity,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerTeamChanged {
pub player: Player,
pub previous: PlayerTeam,
pub new: PlayerTeam,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerActiveWeaponChanged {
pub player: Player,
pub previous: Option<String>,
pub new: Option<String>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct PlayerStatsChanged {
pub player: Player,
pub previous: MatchStats,
pub new: MatchStats,
}
#[derive(Clone, Debug, PartialEq)]
pub struct RoundUpdated {
pub previous_phase: RoundPhase,
pub new_phase: RoundPhase,
}
#[derive(Clone, Debug, PartialEq)]
pub struct RoundPhaseUpdated {
pub previous: RoundPhase,
pub new: RoundPhase,
}
#[derive(Clone, Debug, PartialEq)]
pub struct RoundStarted;
#[derive(Clone, Debug, PartialEq)]
pub struct RoundConcluded {
pub winning_team: WinningTeam,
}
#[derive(Clone, Debug, PartialEq)]
pub struct FreezetimeStarted;
#[derive(Clone, Debug, PartialEq)]
pub struct FreezetimeOver;
#[derive(Clone, Debug, PartialEq)]
pub struct MatchStarted;
#[derive(Clone, Debug, PartialEq)]
pub struct GameOver;
#[derive(Clone, Debug, PartialEq)]
pub struct BombStateUpdated {
pub previous: BombRoundState,
pub new: BombRoundState,
}
#[derive(Clone, Debug, PartialEq)]
pub struct MapUpdated;
#[derive(Clone, Debug, PartialEq)]
pub struct GamemodeChanged {
pub previous: String,
pub new: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct LevelChanged {
pub previous: String,
pub new: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct MapPhaseChanged {
pub previous: MapPhase,
pub new: MapPhase,
}
#[derive(Clone, Debug, PartialEq)]
pub struct TeamScoreChanged {
pub team: PlayerTeam,
pub previous: u32,
pub new: u32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct BombUpdated;
#[derive(Clone, Debug, PartialEq)]
pub struct BombPlanting;
#[derive(Clone, Debug, PartialEq)]
pub struct BombPlanted;
#[derive(Clone, Debug, PartialEq)]
pub struct BombDefusing;
#[derive(Clone, Debug, PartialEq)]
pub struct BombDefused;
#[derive(Clone, Debug, PartialEq)]
pub struct BombExploded;
#[derive(Clone, Debug, PartialEq)]
pub struct BombDropped;
#[derive(Clone, Debug, PartialEq)]
pub struct BombPickedUp;
#[derive(Clone, Debug, PartialEq)]
pub struct KillFeed {
pub killer: Player,
pub victim: Player,
pub weapon: Option<String>,
pub is_headshot: bool,
}
#[derive(Clone, Debug, PartialEq)]
pub struct AuthUpdated;
#[derive(Clone, Debug, PartialEq)]
pub struct ProviderUpdated {
pub previous: Provider,
pub new: Provider,
}
#[derive(Clone, Debug, PartialEq)]
pub struct NewGameState {
pub state: GameState,
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
#[allow(missing_docs)] pub enum GameEvent {
NewGameState(Box<NewGameState>),
AuthUpdated(AuthUpdated),
ProviderUpdated(ProviderUpdated),
MapUpdated(MapUpdated),
GamemodeChanged(GamemodeChanged),
LevelChanged(LevelChanged),
MapPhaseChanged(MapPhaseChanged),
TeamScoreChanged(TeamScoreChanged),
RoundUpdated(RoundUpdated),
RoundPhaseUpdated(RoundPhaseUpdated),
RoundStarted(RoundStarted),
RoundConcluded(RoundConcluded),
FreezetimeStarted(FreezetimeStarted),
FreezetimeOver(FreezetimeOver),
MatchStarted(MatchStarted),
GameOver(GameOver),
BombStateUpdated(BombStateUpdated),
BombUpdated(BombUpdated),
BombPlanting(BombPlanting),
BombPlanted(BombPlanted),
BombDefusing(BombDefusing),
BombDefused(BombDefused),
BombExploded(BombExploded),
BombDropped(BombDropped),
BombPickedUp(BombPickedUp),
PlayerUpdated(PlayerUpdated),
PlayerDied(PlayerDied),
PlayerRespawned(PlayerRespawned),
PlayerTookDamage(PlayerTookDamage),
PlayerGotKill(PlayerGotKill),
PlayerHealthChanged(PlayerHealthChanged),
PlayerArmorChanged(PlayerArmorChanged),
PlayerHelmetChanged(PlayerHelmetChanged),
PlayerFlashAmountChanged(PlayerFlashAmountChanged),
PlayerSmokedAmountChanged(PlayerSmokedAmountChanged),
PlayerBurningAmountChanged(PlayerBurningAmountChanged),
PlayerMoneyAmountChanged(PlayerMoneyAmountChanged),
PlayerEquipmentValueChanged(PlayerEquipmentValueChanged),
PlayerRoundKillsChanged(PlayerRoundKillsChanged),
PlayerRoundHeadshotKillsChanged(PlayerRoundHeadshotKillsChanged),
PlayerRoundTotalDamageChanged(PlayerRoundTotalDamageChanged),
PlayerActivityChanged(PlayerActivityChanged),
PlayerTeamChanged(PlayerTeamChanged),
PlayerActiveWeaponChanged(PlayerActiveWeaponChanged),
PlayerStatsChanged(PlayerStatsChanged),
KillFeed(KillFeed),
}