use super::EnumStr;
use enum_map::Enum;
use serde::{Deserialize, Serialize};
#[derive(Enum, PartialEq, Eq, Clone, Copy, Hash, Serialize, Deserialize, Debug)]
pub enum Technology {
Agriculture,
Pottery,
AnimalHusbandry,
Archery,
Mining,
Sailing,
Calendar,
Writing,
Trapping,
TheWheel,
Masonry,
BronzeWorking,
Optics,
HorsebackRiding,
Mathematics,
Construction,
Philosophy,
DramaAndPoetry,
Currency,
Engineering,
IronWorking,
Theology,
CivilService,
Guilds,
MetalCasting,
Compass,
Education,
Chivalry,
Machinery,
Physics,
Steel,
Astronomy,
Acoustics,
Banking,
PrintingPress,
Gunpowder,
Navigation,
Architecture,
Economics,
Metallurgy,
Chemistry,
Archaeology,
ScientificTheory,
Industrialization,
Rifling,
MilitaryScience,
Fertilizer,
Biology,
Electricity,
SteamPower,
Dynamite,
Refrigeration,
Radio,
ReplaceableParts,
Flight,
Railroads,
Plastics,
Electronics,
Ballistics,
Combustion,
Pharmaceuticals,
AtomicTheory,
Radar,
CombinedArms,
Ecology,
NuclearFission,
Rocketry,
Computers,
Telecommunications,
MobileTactics,
AdvancedBallistics,
Satellites,
Robotics,
Lasers,
Globalization,
ParticlePhysics,
NuclearFusion,
Nanotechnology,
Stealth,
FutureTech,
}
impl EnumStr for Technology {
fn as_str(&self) -> &'static str {
match self {
Technology::Agriculture => "Agriculture",
Technology::Pottery => "Pottery",
Technology::AnimalHusbandry => "Animal Husbandry",
Technology::Archery => "Archery",
Technology::Mining => "Mining",
Technology::Sailing => "Sailing",
Technology::Calendar => "Calendar",
Technology::Writing => "Writing",
Technology::Trapping => "Trapping",
Technology::TheWheel => "The Wheel",
Technology::Masonry => "Masonry",
Technology::BronzeWorking => "Bronze Working",
Technology::Optics => "Optics",
Technology::HorsebackRiding => "Horseback Riding",
Technology::Mathematics => "Mathematics",
Technology::Construction => "Construction",
Technology::Philosophy => "Philosophy",
Technology::DramaAndPoetry => "Drama and Poetry",
Technology::Currency => "Currency",
Technology::Engineering => "Engineering",
Technology::IronWorking => "Iron Working",
Technology::Theology => "Theology",
Technology::CivilService => "Civil Service",
Technology::Guilds => "Guilds",
Technology::MetalCasting => "Metal Casting",
Technology::Compass => "Compass",
Technology::Education => "Education",
Technology::Chivalry => "Chivalry",
Technology::Machinery => "Machinery",
Technology::Physics => "Physics",
Technology::Steel => "Steel",
Technology::Astronomy => "Astronomy",
Technology::Acoustics => "Acoustics",
Technology::Banking => "Banking",
Technology::PrintingPress => "Printing Press",
Technology::Gunpowder => "Gunpowder",
Technology::Navigation => "Navigation",
Technology::Architecture => "Architecture",
Technology::Economics => "Economics",
Technology::Metallurgy => "Metallurgy",
Technology::Chemistry => "Chemistry",
Technology::Archaeology => "Archaeology",
Technology::ScientificTheory => "Scientific Theory",
Technology::Industrialization => "Industrialization",
Technology::Rifling => "Rifling",
Technology::MilitaryScience => "Military Science",
Technology::Fertilizer => "Fertilizer",
Technology::Biology => "Biology",
Technology::Electricity => "Electricity",
Technology::SteamPower => "Steam Power",
Technology::Dynamite => "Dynamite",
Technology::Refrigeration => "Refrigeration",
Technology::Radio => "Radio",
Technology::ReplaceableParts => "Replaceable Parts",
Technology::Flight => "Flight",
Technology::Railroads => "Railroads",
Technology::Plastics => "Plastics",
Technology::Electronics => "Electronics",
Technology::Ballistics => "Ballistics",
Technology::Combustion => "Combustion",
Technology::Pharmaceuticals => "Pharmaceuticals",
Technology::AtomicTheory => "Atomic Theory",
Technology::Radar => "Radar",
Technology::CombinedArms => "Combined Arms",
Technology::Ecology => "Ecology",
Technology::NuclearFission => "Nuclear Fission",
Technology::Rocketry => "Rocketry",
Technology::Computers => "Computers",
Technology::Telecommunications => "Telecommunications",
Technology::MobileTactics => "Mobile Tactics",
Technology::AdvancedBallistics => "Advanced Ballistics",
Technology::Satellites => "Satellites",
Technology::Robotics => "Robotics",
Technology::Lasers => "Lasers",
Technology::Globalization => "Globalization",
Technology::ParticlePhysics => "Particle Physics",
Technology::NuclearFusion => "Nuclear Fusion",
Technology::Nanotechnology => "Nanotechnology",
Technology::Stealth => "Stealth",
Technology::FutureTech => "Future Tech",
}
}
fn from_str(s: &str) -> Self {
match s {
"Agriculture" => Technology::Agriculture,
"Pottery" => Technology::Pottery,
"Animal Husbandry" => Technology::AnimalHusbandry,
"Archery" => Technology::Archery,
"Mining" => Technology::Mining,
"Sailing" => Technology::Sailing,
"Calendar" => Technology::Calendar,
"Writing" => Technology::Writing,
"Trapping" => Technology::Trapping,
"The Wheel" => Technology::TheWheel,
"Masonry" => Technology::Masonry,
"Bronze Working" => Technology::BronzeWorking,
"Optics" => Technology::Optics,
"Horseback Riding" => Technology::HorsebackRiding,
"Mathematics" => Technology::Mathematics,
"Construction" => Technology::Construction,
"Philosophy" => Technology::Philosophy,
"Drama and Poetry" => Technology::DramaAndPoetry,
"Currency" => Technology::Currency,
"Engineering" => Technology::Engineering,
"Iron Working" => Technology::IronWorking,
"Theology" => Technology::Theology,
"Civil Service" => Technology::CivilService,
"Guilds" => Technology::Guilds,
"Metal Casting" => Technology::MetalCasting,
"Compass" => Technology::Compass,
"Education" => Technology::Education,
"Chivalry" => Technology::Chivalry,
"Machinery" => Technology::Machinery,
"Physics" => Technology::Physics,
"Steel" => Technology::Steel,
"Astronomy" => Technology::Astronomy,
"Acoustics" => Technology::Acoustics,
"Banking" => Technology::Banking,
"Printing Press" => Technology::PrintingPress,
"Gunpowder" => Technology::Gunpowder,
"Navigation" => Technology::Navigation,
"Architecture" => Technology::Architecture,
"Economics" => Technology::Economics,
"Metallurgy" => Technology::Metallurgy,
"Chemistry" => Technology::Chemistry,
"Archaeology" => Technology::Archaeology,
"Scientific Theory" => Technology::ScientificTheory,
"Industrialization" => Technology::Industrialization,
"Rifling" => Technology::Rifling,
"Military Science" => Technology::MilitaryScience,
"Fertilizer" => Technology::Fertilizer,
"Biology" => Technology::Biology,
"Electricity" => Technology::Electricity,
"Steam Power" => Technology::SteamPower,
"Dynamite" => Technology::Dynamite,
"Refrigeration" => Technology::Refrigeration,
"Radio" => Technology::Radio,
"Replaceable Parts" => Technology::ReplaceableParts,
"Flight" => Technology::Flight,
"Railroads" => Technology::Railroads,
"Plastics" => Technology::Plastics,
"Electronics" => Technology::Electronics,
"Ballistics" => Technology::Ballistics,
"Combustion" => Technology::Combustion,
"Pharmaceuticals" => Technology::Pharmaceuticals,
"Atomic Theory" => Technology::AtomicTheory,
"Radar" => Technology::Radar,
"Combined Arms" => Technology::CombinedArms,
"Ecology" => Technology::Ecology,
"Nuclear Fission" => Technology::NuclearFission,
"Rocketry" => Technology::Rocketry,
"Computers" => Technology::Computers,
"Telecommunications" => Technology::Telecommunications,
"Mobile Tactics" => Technology::MobileTactics,
"Advanced Ballistics" => Technology::AdvancedBallistics,
"Satellites" => Technology::Satellites,
"Robotics" => Technology::Robotics,
"Lasers" => Technology::Lasers,
"Globalization" => Technology::Globalization,
"Particle Physics" => Technology::ParticlePhysics,
"Nuclear Fusion" => Technology::NuclearFusion,
"Nanotechnology" => Technology::Nanotechnology,
"Stealth" => Technology::Stealth,
"Future Tech" => Technology::FutureTech,
_ => panic!("Invalid value for {}: {{}}", s),
}
}
}