initiative_core/world/place/region/
mod.rs

1mod geography;
2mod political;
3
4use initiative_macros::WordList;
5use serde::{Deserialize, Serialize};
6
7#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize, WordList)]
8#[serde(into = "&'static str", try_from = "&str")]
9pub enum RegionType {
10    #[term = "region"]
11    Any,
12
13    Geography(geography::GeographyType),
14    Political(political::PoliticalType),
15}
16
17impl RegionType {
18    pub const fn get_emoji(&self) -> Option<&'static str> {
19        match self {
20            Self::Any => None,
21            Self::Geography(subtype) => subtype.get_emoji(),
22            Self::Political(subtype) => subtype.get_emoji(),
23        }
24    }
25}