Merge pull request 'First draft' (#24) from weapons into main
Reviewed-on: #24
This commit is contained in:
commit
f9736ffa1f
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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))]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
//!
|
||||
//!
|
||||
|
||||
#![warn(missing_docs, clippy::missing_docs_in_private_items)]
|
||||
// Internal modules
|
||||
mod graphs;
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 {}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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..)
|
||||
|
|
@ -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<DamageMod>);
|
||||
Loading…
Reference in New Issue