Browse Source

add enumiter to item types

pbs
jake 4 years ago
parent
commit
99cc651fd9
  1. 2
      Cargo.toml
  2. 2
      src/entity/item/armor.rs
  3. 4
      src/entity/item/esweapon.rs
  4. 2
      src/entity/item/mag.rs
  5. 2
      src/entity/item/shield.rs
  6. 2
      src/entity/item/tech.rs
  7. 2
      src/entity/item/tool.rs
  8. 2
      src/entity/item/unit.rs
  9. 4
      src/entity/item/weapon.rs

2
Cargo.toml

@ -32,4 +32,6 @@ lazy_static = "1.4.0"
barrel = { version = "0.6.5", features = ["pg"] }
refinery = { version = "0.3.0", features = ["postgres"] }
sqlx = { version = "0.4.0-beta.1", features = ["postgres", "json", "chrono"] }
strum = "0.19.5"
strum_macros = "0.19"

2
src/entity/item/armor.rs

@ -7,7 +7,7 @@ pub enum ItemParseError {
InvalidArmorType,
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum ArmorType {
Frame,
Armor,

4
src/entity/item/esweapon.rs

@ -9,7 +9,7 @@ pub enum ItemParseError {
InvalidESWeaponName,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, strum_macros::EnumIter)]
pub enum ESWeaponType {
Saber = 0,
Sword,
@ -121,7 +121,7 @@ impl ESWeaponType {
}
}
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, strum_macros::EnumIter)]
pub enum ESWeaponSpecial {
Jellen = 1,
Zalure,

2
src/entity/item/mag.rs

@ -64,7 +64,7 @@ pub enum ItemParseError {
InvalidMagBytes,
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum MagType {
Mag,
Varuna,

2
src/entity/item/shield.rs

@ -6,7 +6,7 @@ pub enum ItemParseError {
InvalidShieldType,
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum ShieldType {
Barrier,
Shield,

2
src/entity/item/tech.rs

@ -1,7 +1,7 @@
use serde::{Serialize, Deserialize};
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum Technique {
Foie,
Gifoie,

2
src/entity/item/tool.rs

@ -6,7 +6,7 @@ pub enum ItemParseError {
InvalidToolType,
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum ToolType {
Monomate,
Dimate,

2
src/entity/item/unit.rs

@ -6,7 +6,7 @@ pub enum ItemParseError {
InvalidUnitType,
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum UnitType {
KnightPower,
GeneralPower,

4
src/entity/item/weapon.rs

@ -45,7 +45,7 @@ impl WeaponAttribute {
}
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, strum_macros::EnumIter)]
pub enum WeaponSpecial {
Draw = 1,
Drain,
@ -141,7 +141,7 @@ impl WeaponSpecial {
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, enum_utils::FromStr, derive_more::Display, strum_macros::EnumIter)]
pub enum WeaponType {
Saber,
Brand,

Loading…
Cancel
Save