use serde::Serialize;
use wowsunpack::game_params::types::BigWorldDistance;
pub use wowsunpack::game_types::ControlPointType;
pub use wowsunpack::game_types::InteractiveZoneType;
use crate::analyzer::decoder::ArtillerySalvo;
use crate::analyzer::decoder::Consumable;
use crate::analyzer::decoder::DeathCause;
use crate::analyzer::decoder::Recognized;
use crate::analyzer::decoder::ShotHit;
use crate::analyzer::decoder::TorpedoData;
use crate::types::AvatarId;
use crate::types::EntityId;
use crate::types::GameClock;
use crate::types::GameParamId;
use crate::types::NormalizedPos;
use crate::types::PlaneId;
use crate::types::WorldPos;
use crate::types::WorldPos2D;
use wowsunpack::game_types::ConsumableUsageParams;
#[derive(Debug, Clone, Serialize)]
pub struct ShipPosition {
pub entity_id: EntityId,
pub position: WorldPos,
pub yaw: f32,
pub pitch: f32,
pub roll: f32,
pub last_updated: GameClock,
}
#[derive(Debug, Clone, Serialize)]
pub struct MinimapPosition {
pub entity_id: EntityId,
pub position: NormalizedPos,
pub heading: f32,
pub visible: bool,
pub visibility_flags: u32,
pub is_invisible: bool,
pub last_updated: GameClock,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct CapturePointState {
pub index: usize,
pub position: Option<WorldPos>,
pub radius: f32,
pub control_point_type: Option<Recognized<ControlPointType>>,
pub team_id: i64,
pub invader_team: i64,
pub progress: (f64, f64),
pub has_invaders: bool,
pub both_inside: bool,
pub is_enabled: bool,
}
#[derive(Debug, Clone, Serialize)]
pub struct BuffZoneState {
pub entity_id: EntityId,
pub position: WorldPos,
pub radius: f32,
pub team_id: i64,
pub is_active: bool,
pub drop_params_id: Option<GameParamId>,
}
#[derive(Debug, Clone, Serialize)]
pub struct CapturedBuff {
pub params_id: GameParamId,
pub team_id: i64,
pub clock: GameClock,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct TeamScore {
pub team_index: usize,
pub score: i64,
}
#[derive(Debug, Clone, Serialize)]
pub struct ScoringRules {
pub team_win_score: i64,
pub hold_reward: i64,
pub hold_period: f32,
pub hold_cp_indices: Vec<usize>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ActiveConsumable {
pub consumable: Recognized<Consumable>,
pub activated_at: GameClock,
pub duration: f32,
pub usage_params: Option<ConsumableUsageParams>,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct BuildingEntity {
pub id: EntityId,
pub position: WorldPos,
pub is_alive: bool,
pub is_hidden: bool,
pub is_suppressed: bool,
pub team_id: i8,
pub params_id: GameParamId,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct SmokeScreenEntity {
pub id: EntityId,
pub radius: BigWorldDistance,
pub position: WorldPos,
pub points: Vec<WorldPos>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ActiveShot {
pub avatar_id: AvatarId,
pub salvo: ArtillerySalvo,
pub fired_at: GameClock,
}
#[derive(Debug, Clone, Serialize)]
pub struct ActiveTorpedo {
pub avatar_id: AvatarId,
pub torpedo: TorpedoData,
pub launched_at: GameClock,
pub updated_at: GameClock,
}
#[derive(Debug, Clone, Serialize)]
pub struct ActivePlane {
pub plane_id: PlaneId,
pub owner_id: EntityId,
pub team_id: u32,
pub params_id: GameParamId,
pub position: WorldPos2D,
pub last_updated: GameClock,
}
#[derive(Debug, Clone, Serialize)]
pub struct ActiveWard {
pub plane_id: PlaneId,
pub position: WorldPos,
pub radius: BigWorldDistance,
pub owner_id: EntityId,
}
#[derive(Debug, Clone, Serialize)]
pub struct KillRecord {
pub clock: GameClock,
pub killer: EntityId,
pub victim: EntityId,
pub cause: Recognized<DeathCause>,
}
#[derive(Debug, Clone, Serialize)]
pub struct DeadShip {
pub clock: GameClock,
pub position: Option<WorldPos>,
pub minimap_position: Option<NormalizedPos>,
}
#[derive(Debug, Clone, Serialize)]
pub struct LocalWeatherZone {
pub name: String,
pub position: WorldPos,
pub radius: f32,
pub params_id: GameParamId,
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_id: Option<EntityId>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ResolvedShotHit {
pub clock: GameClock,
pub hit: ShotHit,
pub victim_entity_id: EntityId,
pub salvo: Option<ArtillerySalvo>,
pub fired_at: Option<GameClock>,
pub victim_position: WorldPos,
pub victim_yaw: f32,
pub victim_pitch: f32,
pub victim_roll: f32,
}