Browse Source

add derives to item structs, make some things public

pbs
jake 4 years ago
parent
commit
d8c6dd817e
  1. 10
      src/entity/character.rs
  2. 7
      src/entity/item/esweapon.rs
  3. 2
      src/entity/item/unit.rs
  4. 4
      src/entity/item/weapon.rs
  5. 3
      src/ship/map/area.rs

10
src/entity/character.rs

@ -7,7 +7,7 @@ use libpso::character::character::{DEFAULT_PALETTE_CONFIG, DEFAULT_TECH_MENU};
use crate::entity::item::tech::Technique;
use crate::entity::account::UserAccountId;
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, enum_utils::FromStr, derive_more::Display, Serialize, Deserialize)]
pub enum CharacterClass {
HUmar,
HUnewearl,
@ -64,7 +64,7 @@ impl Into<u8> for CharacterClass {
}
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, derive_more::Display)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, enum_utils::FromStr, derive_more::Display, Serialize, Deserialize)]
pub enum SectionID {
Viridia,
Greenill,
@ -134,7 +134,7 @@ pub struct TechLevel(pub u8);
#[derive(Clone, Debug)]
pub struct CharacterTechniques {
techs: HashMap<Technique, TechLevel>
pub techs: HashMap<Technique, TechLevel>
}
impl CharacterTechniques {
@ -163,7 +163,7 @@ impl CharacterTechniques {
#[derive(Clone)]
pub struct CharacterConfig {
raw_data: [u8; 0xE8],
pub raw_data: [u8; 0xE8],
}
impl CharacterConfig {
@ -184,7 +184,7 @@ impl CharacterConfig {
#[derive(Clone)]
pub struct CharacterInfoboard {
board: [u16; 172],
pub board: [u16; 172],
}
impl CharacterInfoboard {

7
src/entity/item/esweapon.rs

@ -1,3 +1,4 @@
use serde::{Serialize, Deserialize};
// TODO: actually use this
#[derive(Debug)]
pub enum ItemParseError {
@ -8,7 +9,7 @@ pub enum ItemParseError {
InvalidESWeaponName,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ESWeaponType {
Saber = 0,
Sword,
@ -120,7 +121,7 @@ impl ESWeaponType {
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub enum ESWeaponSpecial {
Jellen = 1,
Zalure,
@ -305,4 +306,4 @@ mod test {
}
}
}

2
src/entity/item/unit.rs

@ -323,7 +323,7 @@ impl UnitType {
}
}
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum UnitModifier {
PlusPlus,
Plus,

4
src/entity/item/weapon.rs

@ -10,7 +10,7 @@ pub enum ItemParseError {
InvalidWeaponAttribute,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)]
#[derive(Debug, Copy, Clone, PartialEq, Hash, Eq, Ord, PartialOrd, Serialize, Deserialize)]
pub enum Attribute {
Native = 1,
ABeast,
@ -45,7 +45,7 @@ impl WeaponAttribute {
}
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum WeaponSpecial {
Draw = 1,
Drain,

3
src/ship/map/area.rs

@ -1,9 +1,10 @@
// TOOD: `pub(super) for most of these?`
use serde::{Serialize, Deserialize};
use std::collections::HashMap;
use thiserror::Error;
use crate::ship::room::Episode;
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum MapArea {
Pioneer2Ep1,
Forest1,

Loading…
Cancel
Save