Expand description
§DFRNG - Darkforge Random Number Generation
A library for random number generation focused on tabletop gaming applications. Built as part of the Darkforge project at Hibiscus Games. It should still be applicable to different game systems.
This crate provides utilities for:
- Dice simulation with various numbers of sides
- Random number generation with different distributions
§Modules
§Examples
use darkforge_rng::dice::{Dice, D20};
use darkforge_rng::rng::Random;
// Create a 20-sided die
let d20 = D20::default();
// Roll the die
let roll = d20.roll();
assert!(roll >= 1 && roll <= 20);
// Roll multiple times
let rolls = d20.roll_pool(3);
assert_eq!(rolls.len(), 3);
Modules§
Enums§
- DFRng
Error - Errors that can occur in DFRNG operations.
Type Aliases§
- Result
- A specialised Result type for DFRNG operations.