ed_journals/modules/odyssey/models/
citizen.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
66
67
68
use std::fmt::{Display, Formatter};

use serde::{Deserialize, Serialize};

/// This is used for bounty targets and other events to specify on foot NPCs.
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub enum Citizen {
    #[serde(rename = "citizensuitai_scientific")]
    Researcher,

    #[serde(rename = "citizensuitai_industrial")]
    Technician,

    #[serde(
        rename = "assaultsuitai_class1",
        alias = "assaultsuitai_class2",
        alias = "assaultsuitai_class3"
    )]
    Commando,

    // TODO this is a guess
    #[serde(
        rename = "heavysuitai_class1",
        alias = "heavysuitai_class2",
        alias = "heavysuitai_class3"
    )]
    Enforcer,

    #[serde(
        rename = "lightassaultsuitai_class1",
        alias = "lightassaultsuitai_class2",
        alias = "lightassaultsuitai_class3"
    )]
    Scout,

    #[serde(
        rename = "closesuitai_class1",
        alias = "closesuitai_class2",
        alias = "closesuitai_class3"
    )]
    Striker,

    // TODO this is a guess
    #[serde(
        rename = "rangedsuitai_class1",
        alias = "rangedsuitai_class2",
        alias = "rangedsuitai_class3"
    )]
    Sniper,
}

impl Display for Citizen {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}",
            match self {
                Citizen::Researcher => "Researcher",
                Citizen::Technician => "Technician",
                Citizen::Commando => "Commando",
                Citizen::Enforcer => "Enforcer",
                Citizen::Scout => "Scout",
                Citizen::Striker => "Striker",
                Citizen::Sniper => "Sniper",
            }
        )
    }
}