civ_map_generator 0.1.10

A civilization map generator
Documentation
// Auto-generated by build.rs, DO NOT EDIT
use super::EnumStr;
use enum_map::Enum;
use serde::{Deserialize, Serialize};

#[derive(Enum, PartialEq, Eq, Clone, Copy, Hash, Serialize, Deserialize, Debug)]
pub enum Feature {
    Forest,
    Jungle,
    Marsh,
    Fallout,
    Oasis,
    Floodplain,
    Ice,
    Atoll,
}

impl EnumStr for Feature {
    fn as_str(&self) -> &'static str {
        match self {
            Feature::Forest => "Forest",
            Feature::Jungle => "Jungle",
            Feature::Marsh => "Marsh",
            Feature::Fallout => "Fallout",
            Feature::Oasis => "Oasis",
            Feature::Floodplain => "Floodplain",
            Feature::Ice => "Ice",
            Feature::Atoll => "Atoll",
        }
    }

    fn from_str(s: &str) -> Self {
        match s {
            "Forest" => Feature::Forest,
            "Jungle" => Feature::Jungle,
            "Marsh" => Feature::Marsh,
            "Fallout" => Feature::Fallout,
            "Oasis" => Feature::Oasis,
            "Floodplain" => Feature::Floodplain,
            "Ice" => Feature::Ice,
            "Atoll" => Feature::Atoll,
            _ => panic!("Invalid value for {}: {{}}", s),
        }
    }
}