From b4933813909ed9665a5669dab3a0282a479b5332 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Tue, 4 Mar 2025 22:25:52 +0100 Subject: [PATCH] Removes a couple more todo --- weaponry/src/interfaces.rs | 4 +- .../src/weaponry_structs/equipement_fields.rs | 106 +++++++++--------- .../equipement_impl_basics.rs | 1 + .../equipement_impl_database.rs | 1 - .../weaponry_structs/equipement_structs.rs | 19 +--- weaponry/src/weaponry_structs/mod.rs | 5 + 6 files changed, 62 insertions(+), 74 deletions(-) diff --git a/weaponry/src/interfaces.rs b/weaponry/src/interfaces.rs index 99f5319..ba67fe1 100644 --- a/weaponry/src/interfaces.rs +++ b/weaponry/src/interfaces.rs @@ -152,7 +152,9 @@ pub(super) type FilterType = Box>>; #[derive(Clone)] /// A generic Filtering function -// TODO: Deref +// DONE: Not implementing deref and allowing for a super pub allows +// implementation to be a little more flexible, however this might +// also be an oversight pub(crate) struct FilterFunction(pub(super) FilterType); /// This element can be converted to tex diff --git a/weaponry/src/weaponry_structs/equipement_fields.rs b/weaponry/src/weaponry_structs/equipement_fields.rs index ace1a90..5780cbc 100644 --- a/weaponry/src/weaponry_structs/equipement_fields.rs +++ b/weaponry/src/weaponry_structs/equipement_fields.rs @@ -127,65 +127,65 @@ mod test { unimplemented!() } } -// TODO[!]: Implement all the soundness below +// // TODO[!]: Implement all the soundness below -/// The final enum of all categories to be given to the character sheet -/// -/// This enum is only created at the end of the refining process with all the given information -/// Note that some weapons might not be created or might be too niche to be created by the recipes -/// however the full cross implementation should cover all weapons or reconsider the validity of said implementation -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum FinalWeaponCategory { - Hast(HastSpecialties), - Slash(SlashSpecialties), - Blunt(BluntSpecialties), - Collosal(ColossalSpeciaties), - Ranged(RangedSpecialties), - Throw(ThrowSpecialties), -} +// /// The final enum of all categories to be given to the character sheet +// /// +// /// This enum is only created at the end of the refining process with all the given information +// /// Note that some weapons might not be created or might be too niche to be created by the recipes +// /// however the full cross implementation should cover all weapons or reconsider the validity of said implementation +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum FinalWeaponCategory { +// Hast(HastSpecialties), +// Slash(SlashSpecialties), +// Blunt(BluntSpecialties), +// Collosal(ColossalSpeciaties), +// Ranged(RangedSpecialties), +// Throw(ThrowSpecialties), +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum HastSpecialties { - Lance, - Staff, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum HastSpecialties { +// Lance, +// Staff, +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum SlashSpecialties { - Sword, - #[deprecated] - Dagger, - Axe, - Claws, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum SlashSpecialties { +// Sword, +// #[deprecated] +// Dagger, +// Axe, +// Claws, +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum BluntSpecialties { - Hammer, - Improvised, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum BluntSpecialties { +// Hammer, +// Improvised, +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum ColossalSpeciaties { - Rhodarak, - Haroth, - Kahml, - Landscapper, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum ColossalSpeciaties { +// Rhodarak, +// Haroth, +// Kahml, +// Landscapper, +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum RangedSpecialties { - Bow, - Crossbow, - Cannon, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum RangedSpecialties { +// Bow, +// Crossbow, +// Cannon, +// } -#[allow(dead_code, clippy::missing_docs_in_private_items)] -pub enum ThrowSpecialties { - Light, - Lances, - Improvised, -} +// #[allow(dead_code, clippy::missing_docs_in_private_items)] +// pub enum ThrowSpecialties { +// Light, +// Lances, +// Improvised, +// } // TODO[4]: Have a final weapon category tied to the speciality, if any appliable to the character // : Since this is not needed for balencing, this will be left alone for a while @@ -214,7 +214,6 @@ pub enum EquipementSerializedCategory { /// Shield generic category, will be converted into EquipementSection Shields, /// A custom None category, used to forbid a part to be cast upon or from - // TODO: Check the soundness of this implementation None, /// Light size, will be converted to a WeaponBaseSize Light, @@ -240,7 +239,6 @@ pub enum WeaponBaseShape { Armors, Shields, Exotic, - // TODO[!]: Check the soundness of this, as it is not used currently None, } diff --git a/weaponry/src/weaponry_structs/equipement_impl_basics.rs b/weaponry/src/weaponry_structs/equipement_impl_basics.rs index aacec5e..f7ec799 100644 --- a/weaponry/src/weaponry_structs/equipement_impl_basics.rs +++ b/weaponry/src/weaponry_structs/equipement_impl_basics.rs @@ -30,6 +30,7 @@ impl From for Equipement { } } } + impl From for Equipement { fn from(val: EqMaterial) -> Self { Self { diff --git a/weaponry/src/weaponry_structs/equipement_impl_database.rs b/weaponry/src/weaponry_structs/equipement_impl_database.rs index 27d2374..a1c06b0 100644 --- a/weaponry/src/weaponry_structs/equipement_impl_database.rs +++ b/weaponry/src/weaponry_structs/equipement_impl_database.rs @@ -164,7 +164,6 @@ fn get_sub_categories_from_serde(category: &str) -> Result (Some(WeaponBaseShape::Exotic), None), EquipementSerializedCategory::Armors => (Some(WeaponBaseShape::Armors), None), EquipementSerializedCategory::Shields => (Some(WeaponBaseShape::Shields), None), - // EquipementSerializedCategory::Weapons => todo!(), EquipementSerializedCategory::None => (Some(WeaponBaseShape::None), None), EquipementSerializedCategory::Light => (None, Some(WeaponBaseSize::Light)), EquipementSerializedCategory::Medium => (None, Some(WeaponBaseSize::Medium)), diff --git a/weaponry/src/weaponry_structs/equipement_structs.rs b/weaponry/src/weaponry_structs/equipement_structs.rs index 8ad1f54..c7a5a86 100644 --- a/weaponry/src/weaponry_structs/equipement_structs.rs +++ b/weaponry/src/weaponry_structs/equipement_structs.rs @@ -25,23 +25,6 @@ pub struct InitialEquipementList { pub(super) inner: Vec, } -// impl InitialEquipementList { -// pub fn from_iter_with_intermediate( -// iterator: &mut dyn Iterator, -// ) -> Self -// where -// IntermediateType: Into, -// IntoEquipementType: Into, -// { -// Self { -// inner: iterator -// .into_iter() -// .map(|element| IntermediateType::from(element.into())) -// .collect(), -// } -// } -// } - /// The final equipement, obtained by combining all parts #[derive(Clone, Debug)] #[cfg_attr(test, derive(PartialEq))] @@ -78,7 +61,7 @@ pub(crate) fn filter_id_unique_and_right_category() (Some(a), Some(b)) => a.can_apply_onto(b), // TODO: Unsound to have a generic nature, this should be caught at serialisation // There is no target and the part about to be added is generic - (None, _) => true, // panic!("The EqNature about to be added cannot be generic"), + (None, _) => panic!("The EqNature about to be added cannot be generic"), (Some(_), None) => panic!("The part about to be added unto cannot be generic"), } } diff --git a/weaponry/src/weaponry_structs/mod.rs b/weaponry/src/weaponry_structs/mod.rs index c2280af..d03f50d 100644 --- a/weaponry/src/weaponry_structs/mod.rs +++ b/weaponry/src/weaponry_structs/mod.rs @@ -44,3 +44,8 @@ pub use equipement_fields::{ }; // Likely ? Final Re-Exports pub use equipement_scenario::CrossRecipeScenario; + +// // TODO[!]: Add a sensible prelude +// mod prelude{ + +// }