1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! # Praeda - Procedural Loot Generator
//!
//! A high-performance procedural loot generator library designed for game development.
//! Generate randomized items with qualities, affixes, and attributes using configurable rules.
//!
//! ## Features
//!
//! - **Procedural Item Generation**: Create unique items with random qualities and properties
//! - **Affix System**: Apply prefixes and suffixes to items
//! - **Attribute System**: Define custom attributes (damage, defense, health, etc.)
//! - **Quality/Rarity Tiers**: Configure weighted quality levels (common, rare, legendary, etc.)
//! - **Flexible Configuration**: Use TOML files or programmatic API
//! - **FFI Bindings**: Call from C++, C#, and other languages
//!
//! ## Quick Start (Rust Library)
//!
//! ```rust
//! use praeda::{PraedaGenerator, GeneratorOptions, GeneratorOverrides};
//!
//! let mut generator = PraedaGenerator::new();
//!
//! // Configure qualities (rarity tiers)
//! generator.set_quality_data("common", 100);
//! generator.set_quality_data("rare", 30);
//! generator.set_quality_data("legendary", 5);
//!
//! // Configure item types
//! generator.set_item_type("weapon", 2);
//! generator.set_item_subtype("weapon", "sword", 3);
//! generator.set_item_subtype("weapon", "axe", 2);
//!
//! // Generate items with options
//! let options = GeneratorOptions {
//! number_of_items: 5,
//! base_level: 10.0,
//! level_variance: 2.0,
//! affix_chance: 0.25,
//! linear: true,
//! scaling_factor: 1.5,
//! };
//!
//! let items = generator.generate_loot(&options, &GeneratorOverrides::empty(), "main")?;
//! for item in items {
//! println!("Generated: {} ({})", item.name, item.quality);
//! }
//! # Ok::<_, Box<dyn std::error::Error>>(())
//! ```
//!
//! ## Configuration
//!
//! ### Using TOML Files
//!
//! Define a TOML file with your loot configuration:
//!
//! ```toml
//! [quality_data]
//! common = 100
//! rare = 30
//! legendary = 5
//!
//! [[item_types]]
//! item_type = "weapon"
//! weight = 2
//! [item_types.subtypes]
//! sword = 3
//! axe = 2
//! ```
//!
//! Then load it:
//!
//! ```rust,ignore
//! let mut generator = PraedaGenerator::new();
//! generator.load_data_from_file("loot.toml")?;
//! ```
//!
//! ### Programmatic Configuration
//!
//! Use the [`PraedaGenerator`] API to configure qualities, item types, affixes, and attributes.
//!
//! ## Core Types
//!
//! - [`PraedaGenerator`] - Main generator for creating loot
//! - [`Item`] - A generated item with quality, type, affixes, and attributes
//! - [`Affix`] - Prefix or suffix applied to items
//! - [`ItemAttribute`] - Custom attribute on an item
//! - [`GeneratorOptions`] - Options controlling generation behavior
//! - [`PraedaError`] - Error type for operation failures
//!
//! ## FFI Usage (C, C++, C#)
//!
//! This library provides C-compatible FFI bindings for non-Rust languages.
//! See the `ffi` module or the [FFI documentation](https://github.com/edover/praeda/blob/master/FFI.md)
//! for language-specific examples and detailed API reference.
pub use *;
pub use *;
pub use *;