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
//! Core dice primitives and roll orchestration for `rdice`.
//!
//! `rdice_core` owns the domain model used by the command-line and terminal
//! interfaces: dice, trays, roll expressions, random rolls, and deterministic
//! roll analysis.
//!
//! # Quick start
//!
//! ```
//! use rdice_core::{DiceEngine, FaceValue, parse_roll_exprs};
//!
//! let mut engine = DiceEngine::new();
//! engine.create_die(
//! "Coin",
//! vec![FaceValue::Text("heads".into()), FaceValue::Text("tails".into())],
//! )?;
//!
//! let parsed = parse_roll_exprs(&["2d6", "Coin", "3"])?;
//! let analysis = engine.analyze_roll(&parsed.dice, &parsed.modifiers)?;
//!
//! assert_eq!(analysis.point_range.min, 5);
//! assert_eq!(analysis.point_range.max, 15);
//!
//! # Ok::<(), rdice_core::DiceError>(())
//! ```
//!
//! # Naming
//!
//! Built-in dice are exposed with uppercase names such as `D6` and `D20`.
//! Numeric roll expressions are case-insensitive, so `d6` and `D6` resolve to
//! the same die. Custom dice are stored with [`CUSTOM_PREFIX`] internally, but
//! API methods that accept die names also accept the unprefixed custom name.
/// Dice definitions and face values.
/// Roll execution, roll analysis, and tray operations.
/// Error and result types returned by the crate.
/// Parsing helpers for compact dice roll expressions.
/// Tray data structures used to group persistent dice slots.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;