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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use serde::{Deserialize, Serialize};

use crate::modules::materials::{Material, MaterialCategory};
use crate::modules::ship::ShipModule;
use crate::modules::trading::Commodity;

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct TechnologyBrokerEvent {
    pub broker_type: TechnologyBrokerEventBrokerType,

    #[serde(rename = "MarketID")]
    pub market_id: u64,
    pub items_unlocked: Vec<TechnologyBrokerEventUnlockedItem>,
    pub commodities: Vec<TechnologyBrokerEventCommodity>,
    pub materials: Vec<TechnologyBrokerEventMaterial>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum TechnologyBrokerEventBrokerType {
    #[serde(rename = "guardian")]
    Guardian,

    #[serde(rename = "rescue")]
    Rescue,

    #[serde(rename = "human")]
    Human,

    #[serde(rename = "sirius")]
    Sirius,

    #[serde(rename = "salvation")]
    Salvation,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct TechnologyBrokerEventUnlockedItem {
    pub name: ShipModule,

    #[serde(rename = "Name_Localised")]
    pub name_localized: Option<String>,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct TechnologyBrokerEventCommodity {
    pub name: Commodity,

    #[serde(rename = "Name_Localised")]
    pub name_localized: Option<String>,
    pub count: u16,
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct TechnologyBrokerEventMaterial {
    pub name: Material,

    #[serde(rename = "Name_Localised")]
    pub name_localized: Option<String>,
    pub count: u16,
    pub category: MaterialCategory,
}