diff --git a/cli_parser/src/lib.rs b/cli_parser/src/lib.rs index adfaa4e..f23ffdd 100644 --- a/cli_parser/src/lib.rs +++ b/cli_parser/src/lib.rs @@ -1,5 +1,7 @@ //! The usual cli parser shenenigans //! +#![warn(missing_docs, clippy::missing_docs_in_private_items)] + use clap::{Args, Parser, Subcommand}; use config::{ graph::GraphConfig, @@ -43,6 +45,7 @@ pub enum Commands { } #[derive(Debug, Args)] +/// Genrate the config file with the specified arguments pub struct ConfigArgs { /// Wether to write the config to file, or just show it #[arg(short, long, default_value_t = false)] diff --git a/config/src/graph.rs b/config/src/graph.rs index 0b2db3b..060e996 100644 --- a/config/src/graph.rs +++ b/config/src/graph.rs @@ -1,12 +1,13 @@ // Workspace: config // File: config/src/graph.rs -// Graphconfig +//! The inner config for graph module +//! use clap::Args; use phf::phf_map; use std::sync::LazyLock; #[derive(Args, Debug, Clone)] -/// The configuration struct for the PdfMaker +/// The configuration struct for the Graph pub struct GraphConfig { /// Special target #[arg(help = format!("The target to execute [{}]", *HELP_STR_TO_GRAPH))] diff --git a/config/src/lib.rs b/config/src/lib.rs index 920904a..94b3c35 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -4,6 +4,8 @@ //! //! Also write configs to disk +#![warn(missing_docs, clippy::missing_docs_in_private_items)] + // Internal Modules pub mod graph; pub mod make; diff --git a/config/src/make.rs b/config/src/make.rs index b0f7c67..4a777de 100644 --- a/config/src/make.rs +++ b/config/src/make.rs @@ -1,6 +1,6 @@ // Workspace: config // File: config/src/make.rs -// Makepdf generation structs +//! Makepdf generation structs use phf::phf_map; use std::{collections::HashMap, fmt::Debug, sync::LazyLock}; diff --git a/graphs/src/lib.rs b/graphs/src/lib.rs index f0b501f..35d6594 100644 --- a/graphs/src/lib.rs +++ b/graphs/src/lib.rs @@ -2,6 +2,7 @@ //! //! +#![warn(missing_docs, clippy::missing_docs_in_private_items)] // Internal modules mod graphs; // diff --git a/make/src/lib.rs b/make/src/lib.rs index 1034e41..bc35f63 100644 --- a/make/src/lib.rs +++ b/make/src/lib.rs @@ -18,6 +18,8 @@ //! across different parts of the build process. It includes items such as enums, structs, and traits //! that help in organizing and managing the various components involved in creating a PDF from LaTeX files. //! + +#![warn(missing_docs, clippy::missing_docs_in_private_items)] // Internal modules mod makepdf; mod makepdf_functions; diff --git a/stats/src/lib.rs b/stats/src/lib.rs index 81d142d..42f5406 100644 --- a/stats/src/lib.rs +++ b/stats/src/lib.rs @@ -10,6 +10,7 @@ //! - `stat_structs`: Defines data structures used for managing statistical weights and matrix operations. //! - `stat_io`: Handles input/output operations, such as loading stat records from configuration files. +#![warn(missing_docs, clippy::missing_docs_in_private_items)] // Internal modules mod stat_algo; mod stat_io; diff --git a/tablegen/src/lib.rs b/tablegen/src/lib.rs index cee6946..fa29283 100644 --- a/tablegen/src/lib.rs +++ b/tablegen/src/lib.rs @@ -18,6 +18,8 @@ //! The following functions are re-exported from the module `tablegen`: //! //! - [`table_gen`]: Handling the whole conversion and auto dispatch. + +#![warn(missing_docs, clippy::missing_docs_in_private_items)] mod table_structs; mod table_types; mod tablegen; diff --git a/weaponry/src/database.rs b/weaponry/src/database.rs new file mode 100644 index 0000000..1ac040d --- /dev/null +++ b/weaponry/src/database.rs @@ -0,0 +1,4 @@ +// Workspace: weaponry +// File: weaponry/src/database.rs +//! Database handiling module +//! Implements the basics deserialisation from a database to the weaponry components diff --git a/weaponry/src/export.rs b/weaponry/src/export.rs new file mode 100644 index 0000000..03cffb7 --- /dev/null +++ b/weaponry/src/export.rs @@ -0,0 +1,3 @@ +// Workspace: weaponry +// File: weaponry/src/export.rs +//! Export module in charge of transforming data structure into their tex counterpart through the appropriate traits diff --git a/weaponry/src/interfaces.rs b/weaponry/src/interfaces.rs new file mode 100644 index 0000000..32b050c --- /dev/null +++ b/weaponry/src/interfaces.rs @@ -0,0 +1,12 @@ +// Workspace: weaponry +// File: weaponry/src/interfaces.rs +//! Interface module holding all necesary traits +//! A good amount of effort is made to keep the code polymorphic enough to allow +//! handling of the whole crafting process when the times comes +#![allow(dead_code)] + +/// This element can be converted to tex +pub trait ToTex {} + +/// Specify this element can be made from parts (Unsure, maybe a way to ensure Add is presend ?) +pub trait FromParts {} diff --git a/weaponry/src/lib.rs b/weaponry/src/lib.rs index b93cf3f..dc0d79d 100644 --- a/weaponry/src/lib.rs +++ b/weaponry/src/lib.rs @@ -1,14 +1,11 @@ -pub fn add(left: u64, right: u64) -> u64 { - left + right -} +// Workspace: weaponry +// File: weaponry/src/lib.rs +//! Weaponry module, handling all weaponry creation and analysis -#[cfg(test)] -mod tests { - use super::*; +#![warn(missing_docs, clippy::missing_docs_in_private_items)] - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} +mod database; +mod export; +mod interfaces; +mod strategy; +mod weaponry_structs; diff --git a/weaponry/src/strategy.rs b/weaponry/src/strategy.rs new file mode 100644 index 0000000..617b4ef --- /dev/null +++ b/weaponry/src/strategy.rs @@ -0,0 +1,6 @@ +// Workspace: weaponry +// File: weaponry/src/strategy.rs +//! All different algorythms and strategies to create a weapon +//! +//! These strategies can lock a parameter to allow a more fine tuned balancing +//! or balancing specifically one parameter (balancing materials, balencing finishes etc..) diff --git a/weaponry/src/weaponry_structs.rs b/weaponry/src/weaponry_structs.rs new file mode 100644 index 0000000..e10f106 --- /dev/null +++ b/weaponry/src/weaponry_structs.rs @@ -0,0 +1,72 @@ +// Workspace: weaponry +// File: weaponry/src/weaponry_structs.rs +//! All weaponry intermod structures + +#![allow(dead_code)] + +/// The inner statistics of the equipement, used across all parts and final weapon +#[derive(Default)] +pub struct InnerStats {} + +/// The final equipement, obtained by combining all parts +pub struct Equipement { + /// The inner stats used by the equipement + stats: InnerStats, +} + +/// Shape of the equipement, first mandatory part of an equipement +pub struct EqShape { + /// The inner stats of the part + stats: InnerStats, +} + +/// Material used for the equipement, all equipements are crafted with 1-2 materials +pub struct EqMaterial { + /// The inner stats of the part + stats: InnerStats, +} + +/// Nature of the equipement, some natures are reserved and some can be chained +/// +/// Deciding on the combinaison can be tricky an will need an extra field +pub struct EqNature { + /// The inner stats of the part + stats: InnerStats, + /// Which kind of target this nature applies to + target: NatureTarget, +} + +/// Finishing touches, since all of them have a cost, they are treated in a special fashion +pub struct EqFinishing { + /// The inner stats of the part + stats: InnerStats, +} + +/// The kind of target this nature can apply to +pub enum NatureTarget { + /// Can apply to a weapon and is unique + WeaponUnique, + /// Can apply to a weapon and must be combined with another + WeaponCombined, + /// Can apply to an armor (all armor nature are unique) + Armor, +} + +/// Weapon damage types +#[allow(clippy::missing_docs_in_private_items)] +pub enum SingleDamageType { + Blunt, + Slash, + Pierce, +} + +/// Weapon damage, signifying wether the damage is pure or [secondary] or [[tertiary]] +#[allow(clippy::missing_docs_in_private_items)] +pub enum DamageMod { + Primary(SingleDamageType), + Secondary(SingleDamageType), + Tertiary(SingleDamageType), +} + +/// Damage values, meant to be serialised to tex and deserialized directly from the table +pub struct DamageType(Vec);