Skip to content

Commit

Permalink
🚚 Rename localised to localized
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed May 5, 2024
1 parent b2fb8fa commit 4bcd58f
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct BackpackEventObject {
pub name: Item,

#[serde(rename = "Name_Localised")]
pub name_localised: String,
pub name_localized: String,

#[serde(rename = "OwnerID")]
pub owner_id: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct BuySuitEvent {
pub name: Suit,

#[serde(rename = "Name_Localised")]
pub name_localised: String,
pub name_localized: String,
pub price: u64,

#[serde(rename = "SuitID")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ pub struct CodexEntryEvent {
pub name: CodexEntry,

#[serde(rename = "Name_Localised")]
pub name_localised: String,
pub name_localized: String,
pub category: CodexEntryEventCategory,

#[serde(rename = "Category_Localised")]
pub category_localised: String,
pub category_localized: String,
pub sub_category: CodexEntryEventSubcategory,

#[serde(rename = "SubCategory_Localised")]
pub sub_category_localised: String,
pub sub_category_localized: String,
pub region: Region,

#[serde(rename = "Region_Localised")]
pub region_localised: String,
pub region_localized: String,

pub system: String,
pub system_address: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct CreateSuitLoadoutEvent {
pub suit_name: Suit,

#[serde(rename = "SuitName_Localised")]
pub suit_name_localised: String,
pub suit_name_localized: String,
pub suit_mods: Vec<CreateSuitLoadoutEventMod>,

#[serde(rename = "LoadoutID")]
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct CreateSuitLoadoutEventModule {
pub module_name: String,

#[serde(rename = "ModuleName_Localised")]
pub module_name_localised: String,
pub module_name_localized: String,
pub class: u8,
pub weapon_mods: Vec<CreateSuitLoadoutEventModuleWeaponMod>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct DockSRVEvent {
pub srv_type: SRVType,

#[serde(rename = "SRVType_Localised")]
pub srv_type_localised: String,
pub srv_type_localized: String,

#[serde(rename = "ID")]
pub id: u8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct FSSSignalDiscoveredEvent {
pub signal_name: String,

#[serde(rename = "SignalName_Localised")]
pub signal_name_localised: Option<String>,
pub signal_name_localized: Option<String>,

#[serde(default)]
pub is_station: bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct LaunchSRVEvent {
pub srv_type: SRVType,

#[serde(rename = "SRVType_Localised")]
pub srv_type_localised: String,
pub srv_type_localized: String,

// TODO check if this can be replaced with an enum
pub loadout: String,
Expand Down
9 changes: 6 additions & 3 deletions ed-journals/src/models/journal_event_content/loadout_event.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::Deserialize;
use crate::journal_event_content::shared::ship::ship_module::ShipModule;
use crate::journal_event_content::shared::ship::ship_slot::ShipSlot;
use crate::journal_event_content::shared::ship::ship_type::ShipType;

#[derive(Debug, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct LoadoutEvent {
pub ship: String,
pub ship: ShipType,

#[serde(rename = "ShipID")]
pub ship_id: u32,
Expand All @@ -15,8 +18,8 @@ pub struct LoadoutEvent {
#[derive(Debug, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct LoadoutModule {
pub slot: String,
pub item: String,
pub slot: ShipSlot,
pub item: ShipModule,
pub on: bool,
pub priority: u8,
pub health: f32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct LocationEventStationEconomy {
pub name: String,

#[serde(rename = "Name_Localised")]
pub name_localised: String,
pub name_localized: String,
pub proportion: f32,
}

Expand All @@ -46,7 +46,7 @@ pub struct LocationEventFaction {
pub happiness: String,

#[serde(rename = "Happiness_Localised")]
pub happiness_localised: String,
pub happiness_localized: String,
pub my_reputation: f32,

#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use serde::Deserialize;
use crate::journal_event_content::shared::station::mission_type::MissionType;

#[derive(Debug, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
Expand All @@ -13,7 +14,7 @@ pub struct MissionsEvent {
pub struct MissionEventEntry {
#[serde(rename = "MissionID")]
pub mission_id: u32,
pub name: String,
pub name: MissionType,
pub passenger_mission: bool,
pub expires: u32,
}
Expand All @@ -22,6 +23,7 @@ pub struct MissionEventEntry {
mod tests {
use crate::models::journal_event_content::missions_event::{MissionEventEntry, MissionsEvent};
use serde_json::json;
use crate::journal_event_content::shared::station::mission_type::MissionType;

#[test]
fn mission_event_is_parsed_correctly() {
Expand All @@ -42,7 +44,7 @@ mod tests {
let expected = MissionsEvent {
active: vec![MissionEventEntry {
mission_id: 65380900,
name: "Mission_Courier_name".to_string(),
name: MissionType::DataCourier,
passenger_mission: false,
expires: 82751,
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct ModuleStoreEvent {
pub stored_item: ShipModule,

#[serde(rename = "StoredItem_Localised")]
pub stored_item_localised: String,
pub stored_item_localized: String,
pub ship: ShipType,

#[serde(rename = "ShipID")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Faction {
pub happiness: FactionHappiness,

#[serde(rename = "Happiness_Localised")]
pub happiness_localised: Option<String>,
pub happiness_localized: Option<String>,
pub my_reputation: f32,

#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct ShipTargetedEventScanStageLocked {
pub ship: ShipType,

#[serde(rename = "Ship_Localised")]
pub ship_localised: Option<String>,
pub ship_localized: Option<String>,
}

#[derive(Debug, Deserialize, Clone, PartialEq)]
Expand All @@ -36,11 +36,11 @@ pub struct ShipTargetedEventScanStageOne {
pub ship: ShipType,

#[serde(rename = "Ship_Localised")]
pub ship_localised: String,
pub ship_localized: String,
pub pilot_name: String,

#[serde(rename = "PilotName_Localised")]
pub pilot_name_localised: String,
pub pilot_name_localized: String,

pub pilot_rank: String,
}
Expand All @@ -51,13 +51,13 @@ pub struct ShipTargetedEventScanStageTwo {
pub ship: ShipType,

#[serde(rename = "Ship_Localised")]
pub ship_localised: String,
pub ship_localized: String,

// TODO replace this with an enum
pub pilot_name: String,

#[serde(rename = "PilotName_Localised")]
pub pilot_name_localised: String,
pub pilot_name_localized: String,

pub pilot_rank: String,
pub shield_health: f32,
Expand All @@ -70,11 +70,11 @@ pub struct ShipTargetedEventScanStageThree {
pub ship: ShipType,

#[serde(rename = "Ship_Localised")]
pub ship_localised: String,
pub ship_localized: String,
pub pilot_name: String,

#[serde(rename = "PilotName_Localised")]
pub pilot_name_localised: String,
pub pilot_name_localized: String,

pub pilot_rank: String,
pub shield_health: f32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct StoredModulesEventItem {
pub name: String,

#[serde(rename = "Name_Localised")]
pub name_localised: String,
pub name_localized: String,
pub storage_slot: u16,

#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct StoredShipEventLocalShip {
pub ship_type: ShipType,

#[serde(rename = "ShipType_Localised")]
pub ship_type_localised: Option<String>,
pub ship_type_localized: Option<String>,
pub name: Option<String>,
pub value: u64,
pub hot: bool,
Expand All @@ -36,7 +36,7 @@ pub struct StoredShipEventRemoteShip {
pub ship_type: ShipType,

#[serde(rename = "ShipType_Localised")]
pub ship_type_localised: Option<String>,
pub ship_type_localized: Option<String>,
pub name: String,

#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct SuitLoadoutEvent {
pub suit_name: String,

#[serde(rename = "SuitName_Localised")]
pub suit_name_localised: String,
pub suit_name_localized: String,
pub suit_mods: Vec<SuitLoadoutMod>,

#[serde(rename = "LoadoutID")]
Expand All @@ -37,7 +37,7 @@ pub struct SuitLoadoutModule {
pub module_name: String,

#[serde(rename = "ModuleName_Localised")]
pub module_name_localised: String,
pub module_name_localized: String,
pub class: u8,
pub weapon_mods: Vec<SuitLoadoutModuleWeaponMod>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pub struct SupercruiseDestinationDropEvent {

// TODO this appears to be empty if the destination is a fleet carrier
#[serde(rename = "Type_Localised")]
pub type_localised: Option<String>,
pub type_localized: Option<String>,
pub threat: u8,
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct SwitchSuitLoadoutEvent {
pub suit_name: String,

#[serde(rename = "SuitName_Localised")]
pub suit_name_localised: String,
pub suit_name_localized: String,
pub suit_mods: Vec<SwitchSuitLoadoutEventMod>,

#[serde(rename = "LoadoutID")]
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct SwitchSuitLoadoutEventModule {
pub module_name: String,

#[serde(rename = "ModuleName_Localised")]
pub module_name_localised: String,
pub module_name_localized: String,
pub class: u8,
pub weapon_mods: Vec<SwitchSuitLoadoutEventModuleWeaponMod>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct USSDropEvent {
pub uss_type: String,

#[serde(rename = "USSType_Localised")]
pub uss_type_localised: String,
pub uss_type_localized: String,

#[serde(rename = "USSThreat")]
pub uss_threat: u8,
Expand Down

0 comments on commit 4bcd58f

Please sign in to comment.