ravenous-tools/crates/weaponry/flow_and_structure.md

41 lines
2.4 KiB
Markdown

# Introduction
The generic nature of the recipe generator makes it rather complicated to navigate and comprehend;
however while suffering from many developpement mistakes and shortcommings, a good deal of code reuse was averted
# Structure
The inner structures follow the following.
| Underlaying data | Encapsulating Element | Encapsulating list of elements |
|-----------------------|----------------------------|--------------------------------|
| DatabaseInner (DeSer) | None | None |
| BaseInner (Converted) | InitialElement | InitialElementList |
| AdvancedInner (Calc) | RefinedElement (+BaseInner)| RefinedElementList |
# Explainations
| Category | Explainations | Traits | Impls |
|---------------------|------------------------------|----------------------------------------|------------------------|
| DatabaseInner | Deserialization InnerData | FieldsAsSclice | DatabaseEquipementStats|
| BaseInner | BuildingBlock InnerData | FieldAsSlice, Add, From<DatabaseInner> | InnerEquipementStats |
| AdvancedInner | Calculated data for analysis | Serialize, From<DatabaseInner> | AdvancedStats |
| IntermediateElement | Setup InitialElement | | EqFinishing, etc.. |
| InitialElement | Real Elements by Combination | From<InitalElement>, Combinable | Equipement |
| RefinedElement | Export & Analysis | Serialize | RefinedEquipement |
| InitialElementList | Create list by cross combin. | RecipeCollection | InitialEquipementList |
| RefinedElementList | Analysis & Export | From<InitialElementList, (TBD) | RefinedEquipemenList |
# Workflow
* Deserialize data in a deserializing struct
* Convert it to a valid inner element data
* Wrap in in an intermediate element to allow custom filters and advanced checks
* Create an initial element from it
* Wrap these element in a serie of list (by part, shape, finishing, etc).
* Combine these list to create all final elements (by inner combination)
* Process this combination of list into a RefinedElementList
* Analysis or export
* ????
* Profit
# Implementation