initiative_core/world/place/location/settlement/
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 SettlementType {
7    #[alias = "campsite"]
8    Camp,
9    Capital,
10    #[alias = "metropolis"]
11    City,
12    #[alias = "ward"]
13    #[alias = "quarter"]
14    #[alias = "neighborhood"]
15    District,
16    Outpost,
17    #[alias = "hamlet"]
18    #[alias = "village"]
19    #[alias = "parish"]
20    Town,
21}
22
23impl SettlementType {
24    pub const fn get_emoji(&self) -> Option<&'static str> {
25        match self {
26            Self::Camp => Some("🏕"),
27            Self::Capital | Self::City => Some("🏙"),
28            Self::Outpost => Some("🚩"),
29            Self::District | Self::Town => Some("🏘"),
30        }
31    }
32}