fix: update for new data centre changes

This commit is contained in:
Anna 2019-04-24 19:44:38 -04:00
parent b53bb1d8de
commit 6cca74c845
2 changed files with 91 additions and 68 deletions

View File

@ -10,19 +10,23 @@ use std::str::FromStr;
pub enum DataCenter { pub enum DataCenter {
Aether, Aether,
Chaos, Chaos,
Crystal,
Elemental, Elemental,
Gaia, Gaia,
Light,
Mana, Mana,
Primal, Primal,
} }
impl DataCenter { impl DataCenter {
#[cfg(feature = "all_const")] #[cfg(feature = "all_const")]
pub const ALL: [DataCenter; 6] = [ pub const ALL: [DataCenter; 8] = [
DataCenter::Aether, DataCenter::Aether,
DataCenter::Chaos, DataCenter::Chaos,
DataCenter::Crystal,
DataCenter::Elemental, DataCenter::Elemental,
DataCenter::Gaia, DataCenter::Gaia,
DataCenter::Light,
DataCenter::Mana, DataCenter::Mana,
DataCenter::Primal, DataCenter::Primal,
]; ];
@ -31,8 +35,10 @@ impl DataCenter {
match *self { match *self {
DataCenter::Aether => "Aether", DataCenter::Aether => "Aether",
DataCenter::Chaos => "Chaos", DataCenter::Chaos => "Chaos",
DataCenter::Crystal => "Crystal",
DataCenter::Elemental => "Elemental", DataCenter::Elemental => "Elemental",
DataCenter::Gaia => "Gaia", DataCenter::Gaia => "Gaia",
DataCenter::Light => "Light",
DataCenter::Mana => "Mana", DataCenter::Mana => "Mana",
DataCenter::Primal => "Primal", DataCenter::Primal => "Primal",
} }
@ -51,8 +57,10 @@ impl FromStr for DataCenter {
let data_center = match s.to_lowercase().as_str() { let data_center = match s.to_lowercase().as_str() {
"aether" => DataCenter::Aether, "aether" => DataCenter::Aether,
"chaos" => DataCenter::Chaos, "chaos" => DataCenter::Chaos,
"crystal" => DataCenter::Crystal,
"elemental" => DataCenter::Elemental, "elemental" => DataCenter::Elemental,
"gaia" => DataCenter::Gaia, "gaia" => DataCenter::Gaia,
"light" => DataCenter::Light,
"mana" => DataCenter::Mana, "mana" => DataCenter::Mana,
"primal" => DataCenter::Primal, "primal" => DataCenter::Primal,
_ => return Err(UnknownVariant("DataCenter", s.into())) _ => return Err(UnknownVariant("DataCenter", s.into()))

View File

@ -15,30 +15,30 @@ use std::str::FromStr;
pub enum World { pub enum World {
// Aether // Aether
Adamantoise, Adamantoise,
Balmung,
Cactuar, Cactuar,
Coeurl,
Faerie, Faerie,
Gilgamesh, Gilgamesh,
Goblin,
Jenova, Jenova,
Mateus,
Midgardsormr, Midgardsormr,
Sargatanas, Sargatanas,
Siren, Siren,
Zalera,
// Chaos // Chaos
Cerberus, Cerberus,
Lich,
Louisoix, Louisoix,
Moogle, Moogle,
Odin,
Omega, Omega,
Phoenix,
Ragnarok, Ragnarok,
Shiva,
Zodiark, // Crystal
Balmung,
Brynhildr,
Coeurl,
Diabolos,
Goblin,
Malboro,
Mateus,
Zalera,
// Elemental // Elemental
Aegis, Aegis,
@ -65,6 +65,13 @@ pub enum World {
Yojimbo, Yojimbo,
Zeromus, Zeromus,
// Light
Lich,
Odin,
Phoenix,
Shiva,
Zodiark,
// Mana // Mana
Anima, Anima,
Asura, Asura,
@ -80,15 +87,12 @@ pub enum World {
// Primal // Primal
Behemoth, Behemoth,
Brynhildr,
Diabolos,
Excalibur, Excalibur,
Exodus, Exodus,
Famfrit, Famfrit,
Hyperion, Hyperion,
Lamia, Lamia,
Leviathan, Leviathan,
Malboro,
Ultros, Ultros,
} }
@ -97,30 +101,30 @@ impl World {
pub const ALL: [World; 66] = [ pub const ALL: [World; 66] = [
// Aether // Aether
World::Adamantoise, World::Adamantoise,
World::Balmung,
World::Cactuar, World::Cactuar,
World::Coeurl,
World::Faerie, World::Faerie,
World::Gilgamesh, World::Gilgamesh,
World::Goblin,
World::Jenova, World::Jenova,
World::Mateus,
World::Midgardsormr, World::Midgardsormr,
World::Sargatanas, World::Sargatanas,
World::Siren, World::Siren,
World::Zalera,
// Chaos // Chaos
World::Cerberus, World::Cerberus,
World::Lich,
World::Louisoix, World::Louisoix,
World::Moogle, World::Moogle,
World::Odin,
World::Omega, World::Omega,
World::Phoenix,
World::Ragnarok, World::Ragnarok,
World::Shiva,
World::Zodiark, // Crystal
World::Balmung,
World::Brynhildr,
World::Coeurl,
World::Diabolos,
World::Goblin,
World::Malboro,
World::Mateus,
World::Zalera,
// Elemental // Elemental
World::Aegis, World::Aegis,
@ -147,6 +151,13 @@ impl World {
World::Yojimbo, World::Yojimbo,
World::Zeromus, World::Zeromus,
// Light
World::Lich,
World::Odin,
World::Phoenix,
World::Shiva,
World::Zodiark,
// Mana // Mana
World::Anima, World::Anima,
World::Asura, World::Asura,
@ -162,15 +173,12 @@ impl World {
// Primal // Primal
World::Behemoth, World::Behemoth,
World::Brynhildr,
World::Diabolos,
World::Excalibur, World::Excalibur,
World::Exodus, World::Exodus,
World::Famfrit, World::Famfrit,
World::Hyperion, World::Hyperion,
World::Lamia, World::Lamia,
World::Leviathan, World::Leviathan,
World::Malboro,
World::Ultros, World::Ultros,
]; ];
@ -178,29 +186,28 @@ impl World {
pub fn as_str(&self) -> &'static str { pub fn as_str(&self) -> &'static str {
match *self { match *self {
World::Adamantoise => "Adamantoise", World::Adamantoise => "Adamantoise",
World::Balmung => "Balmung",
World::Cactuar => "Cactuar", World::Cactuar => "Cactuar",
World::Coeurl => "Coeurl",
World::Faerie => "Faerie", World::Faerie => "Faerie",
World::Gilgamesh => "Gilgamesh", World::Gilgamesh => "Gilgamesh",
World::Goblin => "Goblin",
World::Jenova => "Jenova", World::Jenova => "Jenova",
World::Mateus => "Mateus",
World::Midgardsormr => "Midgardsormr", World::Midgardsormr => "Midgardsormr",
World::Sargatanas => "Sargatanas", World::Sargatanas => "Sargatanas",
World::Siren => "Siren", World::Siren => "Siren",
World::Zalera => "Zalera",
World::Cerberus => "Cerberus", World::Cerberus => "Cerberus",
World::Lich => "Lich",
World::Louisoix => "Louisoix", World::Louisoix => "Louisoix",
World::Moogle => "Moogle", World::Moogle => "Moogle",
World::Odin => "Odin",
World::Omega => "Omega", World::Omega => "Omega",
World::Phoenix => "Phoenix",
World::Ragnarok => "Ragnarok", World::Ragnarok => "Ragnarok",
World::Shiva => "Shiva",
World::Zodiark => "Zodiark", World::Balmung => "Balmung",
World::Brynhildr => "Brynhildr",
World::Coeurl => "Coeurl",
World::Diabolos => "Diabolos",
World::Goblin => "Goblin",
World::Malboro => "Malboro",
World::Mateus => "Mateus",
World::Zalera => "Zalera",
World::Aegis => "Aegis", World::Aegis => "Aegis",
World::Atomos => "Atomos", World::Atomos => "Atomos",
@ -225,6 +232,12 @@ impl World {
World::Yojimbo => "Yojimbo", World::Yojimbo => "Yojimbo",
World::Zeromus => "Zeromus", World::Zeromus => "Zeromus",
World::Lich => "Lich",
World::Odin => "Odin",
World::Phoenix => "Phoenix",
World::Shiva => "Shiva",
World::Zodiark => "Zodiark",
World::Anima => "Anima", World::Anima => "Anima",
World::Asura => "Asura", World::Asura => "Asura",
World::Belias => "Belias", World::Belias => "Belias",
@ -238,15 +251,12 @@ impl World {
World::Titan => "Titan", World::Titan => "Titan",
World::Behemoth => "Behemoth", World::Behemoth => "Behemoth",
World::Brynhildr => "Brynhildr",
World::Diabolos => "Diabolos",
World::Excalibur => "Excalibur", World::Excalibur => "Excalibur",
World::Exodus => "Exodus", World::Exodus => "Exodus",
World::Famfrit => "Famfrit", World::Famfrit => "Famfrit",
World::Hyperion => "Hyperion", World::Hyperion => "Hyperion",
World::Lamia => "Lamia", World::Lamia => "Lamia",
World::Leviathan => "Leviathan", World::Leviathan => "Leviathan",
World::Malboro => "Malboro",
World::Ultros => "Ultros", World::Ultros => "Ultros",
} }
} }
@ -261,29 +271,28 @@ impl World {
pub fn data_center(&self) -> DataCenter { pub fn data_center(&self) -> DataCenter {
match *self { match *self {
World::Adamantoise | World::Adamantoise |
World::Balmung |
World::Cactuar | World::Cactuar |
World::Coeurl |
World::Faerie | World::Faerie |
World::Gilgamesh | World::Gilgamesh |
World::Goblin |
World::Jenova | World::Jenova |
World::Mateus |
World::Midgardsormr | World::Midgardsormr |
World::Sargatanas | World::Sargatanas |
World::Siren | World::Siren => DataCenter::Aether,
World::Zalera => DataCenter::Aether,
World::Cerberus | World::Cerberus |
World::Lich |
World::Louisoix | World::Louisoix |
World::Moogle | World::Moogle |
World::Odin |
World::Omega | World::Omega |
World::Phoenix | World::Ragnarok => DataCenter::Chaos,
World::Ragnarok |
World::Shiva | World::Balmung |
World::Zodiark => DataCenter::Chaos, World::Brynhildr |
World::Coeurl |
World::Diabolos |
World::Goblin |
World::Malboro |
World::Mateus |
World::Zalera => DataCenter::Crystal,
World::Aegis | World::Aegis |
World::Atomos | World::Atomos |
@ -308,6 +317,12 @@ impl World {
World::Yojimbo | World::Yojimbo |
World::Zeromus => DataCenter::Gaia, World::Zeromus => DataCenter::Gaia,
World::Lich |
World::Odin |
World::Phoenix |
World::Shiva |
World::Zodiark => DataCenter::Light,
World::Anima | World::Anima |
World::Asura | World::Asura |
World::Belias | World::Belias |
@ -320,16 +335,14 @@ impl World {
World::Shinryu | World::Shinryu |
World::Titan => DataCenter::Mana, World::Titan => DataCenter::Mana,
// Primal
World::Behemoth | World::Behemoth |
World::Brynhildr |
World::Diabolos |
World::Excalibur | World::Excalibur |
World::Exodus | World::Exodus |
World::Famfrit | World::Famfrit |
World::Hyperion | World::Hyperion |
World::Lamia | World::Lamia |
World::Leviathan | World::Leviathan |
World::Malboro |
World::Ultros => DataCenter::Primal, World::Ultros => DataCenter::Primal,
} }
} }
@ -344,29 +357,28 @@ impl FromStr for World {
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
let world = match s.to_lowercase().as_str() { let world = match s.to_lowercase().as_str() {
"adamantoise" => World::Adamantoise, "adamantoise" => World::Adamantoise,
"balmung" => World::Balmung,
"cactuar" => World::Cactuar, "cactuar" => World::Cactuar,
"coeurl" => World::Coeurl,
"faerie" => World::Faerie, "faerie" => World::Faerie,
"gilgamesh" => World::Gilgamesh, "gilgamesh" => World::Gilgamesh,
"goblin" => World::Goblin,
"jenova" => World::Jenova, "jenova" => World::Jenova,
"mateus" => World::Mateus,
"midgardsormr" => World::Midgardsormr, "midgardsormr" => World::Midgardsormr,
"sargatanas" => World::Sargatanas, "sargatanas" => World::Sargatanas,
"siren" => World::Siren, "siren" => World::Siren,
"zalera" => World::Zalera,
"cerberus" => World::Cerberus, "cerberus" => World::Cerberus,
"lich" => World::Lich,
"louisoix" => World::Louisoix, "louisoix" => World::Louisoix,
"moogle" => World::Moogle, "moogle" => World::Moogle,
"odin" => World::Odin,
"omega" => World::Omega, "omega" => World::Omega,
"phoenix" => World::Phoenix,
"ragnarok" => World::Ragnarok, "ragnarok" => World::Ragnarok,
"shiva" => World::Shiva,
"zodiark" => World::Zodiark, "balmung" => World::Balmung,
"brynhildr" => World::Brynhildr,
"coeurl" => World::Coeurl,
"diabolos" => World::Diabolos,
"goblin" => World::Goblin,
"malboro" => World::Malboro,
"mateus" => World::Mateus,
"zalera" => World::Zalera,
"aegis" => World::Aegis, "aegis" => World::Aegis,
"atomos" => World::Atomos, "atomos" => World::Atomos,
@ -391,6 +403,12 @@ impl FromStr for World {
"yojimbo" => World::Yojimbo, "yojimbo" => World::Yojimbo,
"zeromus" => World::Zeromus, "zeromus" => World::Zeromus,
"lich" => World::Lich,
"odin" => World::Odin,
"phoenix" => World::Phoenix,
"shiva" => World::Shiva,
"zodiark" => World::Zodiark,
"anima" => World::Anima, "anima" => World::Anima,
"asura" => World::Asura, "asura" => World::Asura,
"belias" => World::Belias, "belias" => World::Belias,
@ -404,15 +422,12 @@ impl FromStr for World {
"titan" => World::Titan, "titan" => World::Titan,
"behemoth" => World::Behemoth, "behemoth" => World::Behemoth,
"brynhildr" => World::Brynhildr,
"diabolos" => World::Diabolos,
"excalibur" => World::Excalibur, "excalibur" => World::Excalibur,
"exodus" => World::Exodus, "exodus" => World::Exodus,
"famfrit" => World::Famfrit, "famfrit" => World::Famfrit,
"hyperion" => World::Hyperion, "hyperion" => World::Hyperion,
"lamia" => World::Lamia, "lamia" => World::Lamia,
"leviathan" => World::Leviathan, "leviathan" => World::Leviathan,
"malboro" => World::Malboro,
"ultros" => World::Ultros, "ultros" => World::Ultros,
_ => return Err(UnknownVariant("World", s.into())) _ => return Err(UnknownVariant("World", s.into()))