ed_journals/modules/logs/content/log_event_content/
ship_targeted_event.rsuse serde::{Deserialize, Serialize};
use crate::modules::ship::ShipType;
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ShipTargetedEvent {
pub target_locked: bool,
#[serde(flatten, default)]
pub scan_stage: Option<ShipTargetedEventScanStage>,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase", untagged)]
pub enum ShipTargetedEventScanStage {
Locked(ShipTargetedEventScanStageLocked),
StageOne(ShipTargetedEventScanStageOne),
StageTwo(ShipTargetedEventScanStageTwo),
StageThree(ShipTargetedEventScanStageThree),
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ShipTargetedEventScanStageLocked {
pub ship: ShipType,
#[serde(rename = "Ship_Localised")]
pub ship_localized: Option<String>,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ShipTargetedEventScanStageOne {
pub ship: ShipType,
#[serde(rename = "Ship_Localised")]
pub ship_localized: String,
pub pilot_name: String,
#[serde(rename = "PilotName_Localised")]
pub pilot_name_localized: String,
pub pilot_rank: String,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ShipTargetedEventScanStageTwo {
pub ship: ShipType,
#[serde(rename = "Ship_Localised")]
pub ship_localized: String,
pub pilot_name: String,
#[serde(rename = "PilotName_Localised")]
pub pilot_name_localized: String,
pub pilot_rank: String,
pub shield_health: f32,
pub hull_health: f32,
}
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ShipTargetedEventScanStageThree {
pub ship: ShipType,
#[serde(rename = "Ship_Localised")]
pub ship_localized: String,
pub pilot_name: String,
#[serde(rename = "PilotName_Localised")]
pub pilot_name_localized: String,
pub pilot_rank: String,
pub shield_health: f32,
pub hull_health: f32,
pub faction: String,
pub legal_status: String,
pub sub_system: String,
pub sub_system_health: f32,
pub power: Option<String>,
}