ed_journals/modules/logs/content/log_event_content/
prospected_asteroid_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
//! Fired when a prospector limpet is used on an asteroid.

use serde::{Deserialize, Serialize};

use crate::modules::trading::Commodity;

/// Fired when a prospector limpet is used on an asteroid.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ProspectedAsteroidEvent {
    /// List of commodities that are available in the given asteroid.
    pub materials: Vec<ProspectedAsteroidEventMaterial>,

    /// The yield of the asteroid. How much of the materials are available.
    pub content: ProspectedAsteroidEventContent,

    /// Localized name of the yield of the asteroid.
    #[serde(rename = "Content_Localised")]
    pub content_localized: Option<String>,

    /// Whether the prospected asteroid contains a mother lode.
    pub motherlode_material: Option<Commodity>,

    /// Localized name of the mother lode commodity, if any.
    #[serde(rename = "MotherlodeMaterial_Localised")]
    pub motherlode_material_localized: Option<String>,

    /// Percentage of total yield remaining for the asteroid.
    pub remaining: f32,
}

/// Commodity entry for a prospected asteroid.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct ProspectedAsteroidEventMaterial {
    /// The commodity available in the asteroid.
    pub name: Commodity,

    /// Localized name of the commodity available.
    #[serde(rename = "Name_Localised")]
    pub name_localized: Option<String>,

    /// The factor the commodity is available in the given asteroid.
    pub proportion: f32,
}

/// Indicative yield for the asteroid.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub enum ProspectedAsteroidEventContent {
    #[serde(rename = "$AsteroidMaterialContent_High;")]
    HighMaterialContent,

    #[serde(rename = "$AsteroidMaterialContent_Medium;")]
    MediumMaterialContent,

    #[serde(rename = "$AsteroidMaterialContent_Low;")]
    LowMaterialContent,
}