diff --git a/src/encode.rs b/src/encode.rs index f7fb769..edf2f0f 100644 --- a/src/encode.rs +++ b/src/encode.rs @@ -1,4 +1,4 @@ -use crate::jsonstruct::{CraftedTypesFr, Durability, FuncParams, Identificationer, ItemTypeDeser, Powder, Shinyjson, Shinystruct}; +use crate::jsonstruct::{CraftedTypesFr, Durability, FuncParams, Identificationer, ItemTypeDeser, Powder, RequirementsDeser, Shinyjson, Shinystruct}; use idmangler_lib::types::{Element, ItemType, RollType, Stat}; use idmangler_lib::{CustomGearTypeData, CustomConsumableTypeData, DataEncoder, EndData, IdentificationData, NameData, PowderData, RerollData, ShinyData, StartData, TypeData, DurabilityData}; use std::collections::HashMap; @@ -76,6 +76,9 @@ pub fn encode_duradata(general_params: &mut FuncParams, real_dura: Durability) - .encode(general_params.fr_ver, general_params.fr_out) .unwrap(); Ok(()) +} +pub fn encode_reqdata(general_params: &mut FuncParams, real_reqdata: RequirementsDeser) { + } pub fn encode_namedata(general_params: &mut FuncParams, real_name: &str) { // ENCODE: NameData diff --git a/src/jsonstruct.rs b/src/jsonstruct.rs index effbd70..0b252bf 100644 --- a/src/jsonstruct.rs +++ b/src/jsonstruct.rs @@ -2,7 +2,7 @@ use crate::errorfr::Errorfr; use idmangler_lib::types::{ItemType, TransformVersion, ConsumableType, GearType}; use serde::Deserialize; use std::fs; -use idmangler_lib::types::{ConsumableType::*,GearType::*}; +use idmangler_lib::types::{ConsumableType::*,GearType::*, ClassType, SkillType}; use crate::jsonstruct::CraftedTypesFr::{Consu, Gear}; // structs for the json parsing @@ -17,12 +17,40 @@ pub struct Jsonconfig { pub name: Option, // durability data (Crafted Gear) pub durability: Option, + // requirements data (Crafted Gear, Crafted + pub requirements: Option, // shiny data pub shiny: Option, + // identifications pub ids: Option>, pub powders: Option>, pub rerolls: Option, } +// reimplementing this because it doesnt have Deserialize. +// Also, changing the SkillPoint stuff into NOT a vec. +// This avoids confusing end user. +#[derive(Deserialize)] +pub struct RequirementsDeser { + level: u8, + class: Option, + sp: SkillPointDeser +} +#[derive(Deserialize)] +pub enum ClassDeser { + Archer, + Warrior, + Assassin, + Mage, + Shaman +} +#[derive(Deserialize)] +pub struct SkillPointDeser { + Earth: Option, + Thunder: Option, + Water: Option, + Fire: Option, + Air: Option +} pub enum CraftedTypesFr { Gear(GearType), Consu(ConsumableType) diff --git a/src/main.rs b/src/main.rs index c2abd68..54cb2e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,6 +173,14 @@ fn cook( _ => {} } + // ENCODE: RequirementsData if ItemType is CraftedGear, CraftedConsu + match json_config.item_type { + ItemTypeDeser::CraftedGear | ItemTypeDeser::CraftedConsu => { + + }, + _ => {} + } + // ENCODE: PowderData if ItemType is Gear, CraftedGear match json_config.item_type { ItemTypeDeser::Gear | ItemTypeDeser::CraftedGear => {