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
//! Tomb is a minimal crate that provides dice rolling mechanisms for games.
//!
//! Why use `tomb`:
//! - The name is great (short for _tombstones_, another name for _dice_)
//! - Requires close to no depdendencies (an optional one for the `fastrand` crate)
//! - Fully tested with generous example code
//!
//! One way to think about `tomb` is as a minimal _headless_ [tabletop simulator][].
//!
//! [tabletop simulator]: https://www.tabletopsimulator.com/
//!
//! # Examples
//!
//! Creating and rolling a D20
//!
//! ```
//! // Optional dependency, exclude to implement your own RNG.
//! use fastrand::Rng;
//!
//! // It is possible to define your own dice, rollers, and to use immutable die as well!
//! use tomb::{D20, RngRoller, RollMut};
//!
//! // Pre-defined seed so the result of this example is predictable.
//! let roller = RngRoller::from(Rng::with_seed(7194422452970863838));
//! let mut d20 = D20::new();
//!
//! roller.roll_mut(&mut d20);
//! assert_eq!(d20.value(), 10);
//! ```
pub use ;
pub use ;
;