From 38fad624a8e9c18c061f978ef20250e0a9f5cabf Mon Sep 17 00:00:00 2001 From: endernon Date: Sat, 11 Jan 2025 19:46:55 +0000 Subject: [PATCH] add a bunch of aliases to struct --- src/jsonstruct.rs | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/jsonstruct.rs b/src/jsonstruct.rs index 2287de5..fc60d34 100644 --- a/src/jsonstruct.rs +++ b/src/jsonstruct.rs @@ -8,22 +8,63 @@ use std::fs; // structs for the json parsing #[derive(Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub struct Jsonconfig { + #[serde(alias = "Debug")] pub debug: Option, // not a thing to be encoded, this just toggles debug prints. Also settable using --debug + #[serde(alias = "itemtype")] + #[serde(alias = "ITEM_TYPE")] + #[serde(alias = "ITEMTYPE")] + #[serde(alias = "Item_Type")] + #[serde(alias = "Item_type")] + #[serde(alias = "ItemType")] + #[serde(alias = "Itemtype")] // Item Types (Gear, Tome, Charm, Crafted Gear, Crafted Consum) pub item_type: ItemTypeDeser, - // Crafted type for Crafted item types ( + #[serde(alias = "craftedtype")] + #[serde(alias = "CRAFTED_TYPE")] + #[serde(alias = "CRAFTEDTYPE")] + #[serde(alias = "Crafted_Type")] + #[serde(alias = "Crafted_type")] + #[serde(alias = "CraftedType")] + #[serde(alias = "Craftedtype")] + // Crafted type for Crafted item types pub crafted_type: Option, + #[serde(alias = "Name")] + #[serde(alias = "NAME")] // name of item pub name: Option, + #[serde(alias = "Durability")] + #[serde(alias = "DURABILITY")] + #[serde(alias = "Dura")] + #[serde(alias = "DURA")] // durability data (Crafted Gear) pub durability: Option, + #[serde(alias = "Requirements")] + #[serde(alias = "REQUIREMENTS")] // requirements data (Crafted Gear, Crafted pub requirements: Option, + #[serde(alias = "Shiny")] + #[serde(alias = "SHINY")] // shiny data pub shiny: Option, + #[serde(alias = "Ids")] + #[serde(alias = "IDS")] + #[serde(alias = "identifications")] + #[serde(alias = "Identifications")] + #[serde(alias = "IDENTIFICATIONS")] // identifications pub ids: Option>, + #[serde(alias = "Powders")] + #[serde(alias = "POWDERS")] + #[serde(alias = "powder")] + #[serde(alias = "Powder")] + #[serde(alias = "POWDER")] + // powders stuff pub powders: Option>, + #[serde(alias = "Rerolls")] + #[serde(alias = "REROLLS")] + #[serde(alias = "reroll")] + #[serde(alias = "Reroll")] + #[serde(alias = "REROLL")] pub rerolls: Option, } // reimplementing this because it doesnt have Deserialize.