ed_journals/modules/logs/content/log_event_content/
materials_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
//! Fired during startup containing a list of material the player currently has.

use serde::{Deserialize, Serialize};

use crate::modules::materials::Material;

/// Fired during startup containing a list of material the player currently has.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct MaterialsEvent {
    /// List of raw materials the player has.
    #[serde(rename = "Raw")]
    pub raw: Vec<MaterialEventEntry>,

    /// List of encoded materials the player has.
    #[serde(rename = "Encoded")]
    pub encoded: Vec<MaterialEventEntry>,

    /// List of manufactured materials the player has.
    #[serde(rename = "Manufactured")]
    pub manufactured: Vec<MaterialEventEntry>,
}

/// Entry for a given material that the player has.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct MaterialEventEntry {
    /// The kind of material the player has inventory for.
    #[serde(rename = "Name")]
    pub name: Material,

    /// The amount of the given material the player has.
    #[serde(rename = "Count")]
    pub count: u16,
}