initiative_core/world/place/building/military/
mod.rs

1use initiative_macros::WordList;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, WordList)]
5#[serde(into = "&'static str", try_from = "&str")]
6pub enum MilitaryType {
7    Barracks,
8    Base,
9    Castle,
10    Citadel,
11    Fort,
12    Fortress,
13    Keep,
14    Stronghold,
15    Tower,
16}
17
18impl MilitaryType {
19    pub const fn get_emoji(&self) -> Option<&'static str> {
20        match self {
21            Self::Castle
22            | Self::Citadel
23            | Self::Fort
24            | Self::Fortress
25            | Self::Keep
26            | Self::Stronghold
27            | Self::Tower => Some("🏰"),
28            Self::Barracks | Self::Base => Some("⚔"),
29        }
30    }
31}