Compare commits

...

5 Commits

Author SHA1 Message Date
Anna 5092e6c7b6
chore: bump version to 1.7.1 2022-06-24 08:22:40 -04:00
Anna 7a9ceb8c6c
fix: include materia in from_str 2022-06-24 08:22:29 -04:00
Anna ce52b5ad9b
chore: bump version to 1.7.0 2022-01-25 01:47:57 -05:00
Anna 783409d02f
feat: add Materia data centre 2022-01-25 01:47:08 -05:00
Anna ed1559fb22
chore: bump version to 1.6.0 2021-12-06 15:52:43 -05:00
3 changed files with 40 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "ffxiv_types"
version = "1.5.0"
version = "1.7.1"
authors = ["Anna Clemens <ffxiv-types@annaclemens.io>"]
description = "Useful types for FFXIV-related projects"
documentation = "https://docs.rs/ffxiv_types"

View File

@ -16,11 +16,12 @@ pub enum DataCenter {
Light,
Mana,
Primal,
Materia,
}
impl DataCenter {
#[cfg(feature = "all_const")]
pub const ALL: [DataCenter; 8] = [
pub const ALL: [DataCenter; 9] = [
DataCenter::Aether,
DataCenter::Chaos,
DataCenter::Crystal,
@ -29,6 +30,7 @@ impl DataCenter {
DataCenter::Light,
DataCenter::Mana,
DataCenter::Primal,
DataCenter::Materia,
];
pub fn as_str(&self) -> &'static str {
@ -41,6 +43,7 @@ impl DataCenter {
DataCenter::Light => "Light",
DataCenter::Mana => "Mana",
DataCenter::Primal => "Primal",
DataCenter::Materia => "Materia",
}
}
@ -63,6 +66,7 @@ impl FromStr for DataCenter {
"light" => DataCenter::Light,
"mana" => DataCenter::Mana,
"primal" => DataCenter::Primal,
"materia" => DataCenter::Materia,
_ => return Err(UnknownVariant("DataCenter", s.into()))
};

View File

@ -96,11 +96,18 @@ pub enum World {
Lamia,
Leviathan,
Ultros,
// Materia
Bismarck,
Ravana,
Sephirot,
Sophia,
Zurvan,
}
impl World {
#[cfg(feature = "all_const")]
pub const ALL: [World; 68] = [
pub const ALL: [World; 73] = [
// Aether
World::Adamantoise,
World::Cactuar,
@ -184,6 +191,13 @@ impl World {
World::Lamia,
World::Leviathan,
World::Ultros,
// Materia
World::Bismarck,
World::Ravana,
World::Sephirot,
World::Sophia,
World::Zurvan,
];
/// Returns the string variant of this world.
@ -264,6 +278,12 @@ impl World {
World::Lamia => "Lamia",
World::Leviathan => "Leviathan",
World::Ultros => "Ultros",
World::Bismarck => "Bismarck",
World::Ravana => "Ravana",
World::Sephirot => "Sephirot",
World::Sophia => "Sophia",
World::Zurvan => "Zurvan",
}
}
@ -352,6 +372,13 @@ impl World {
World::Lamia |
World::Leviathan |
World::Ultros => DataCenter::Primal,
// Materia
World::Bismarck |
World::Ravana |
World::Sephirot |
World::Sophia |
World::Zurvan => DataCenter::Materia,
}
}
}
@ -440,6 +467,12 @@ impl FromStr for World {
"leviathan" => World::Leviathan,
"ultros" => World::Ultros,
"bismarck" => World::Bismarck,
"ravana" => World::Ravana,
"sephirot" => World::Sephirot,
"sophia" => World::Sophia,
"zurvan" => World::Zurvan,
_ => return Err(UnknownVariant("World", s.into()))
};