Skip to main content

ed_journals/modules/logs/content/log_event_content/
module_buy_event.rs

1//! Fired when buying a new module and equipping it to the current active ship.
2
3use serde::{Deserialize, Serialize};
4
5use crate::modules::ship::{ShipModule, ShipSlot, ShipType};
6
7/// Fired when buying a new module and equipping it to the current active ship.
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
9#[serde(rename_all = "PascalCase")]
10pub struct ModuleBuyEvent {
11    /// The slot the module is installed into.
12    pub slot: ShipSlot,
13
14    /// The module that was in the given slot and is now stored at the current location.
15    pub stored_item: Option<ShipModule>,
16
17    /// The localized name of the module that was stored.
18    #[serde(rename = "StoredItem_Localised")]
19    pub stored_item_localized: Option<String>,
20
21    /// The module that was bought and installed in the given slot.
22    pub buy_item: ShipModule,
23
24    /// The localized name of the bought module.
25    #[serde(rename = "BuyItem_Localised")]
26    pub buy_item_localized: Option<String>,
27
28    /// The market id where the module was bought.
29    #[serde(rename = "MarketID")]
30    pub market_id: u64,
31
32    /// The number of credits that were spent on the module.
33    pub buy_price: u64,
34
35    /// The type of the current active ship that the module has been installed onto.
36    pub ship: ShipType,
37
38    /// The id of the current active ship that the module has been installed onto.
39    #[serde(rename = "ShipID")]
40    pub ship_id: u64,
41}