gametools/lib.rs
1//! # gametools
2//!
3//! `gametools` provides utilities for working with common table game apparatus such as card decks,
4//! dice, spinners, and dominos. The goal is to provide flexible, modular tools to simplify prototyping and building
5//! games and simulations.
6//!
7//! ## Features
8//! - Cards module that supports cards of any type, with 1 or 2 faces.
9//! - Pre-defined StandardCard type for standard playing cards.
10//! - Hand analytics for standard cards (detect straight, "n" of a kind, etc.) including Joker / wildcard handling.
11//! - Numeric dice with up to 255 sides.
12//! - Tools for playing with and transforming pools of dice.
13//! - Spinners (random selectors) with "wedges" returning arbitrary types and can be covered/blocked or weighted.
14//! - Domino set creation (up to full double-18) and management.
15//! - Pathfinding with backtracking + pruning to find optimum domino train in a hand.
16//! - Custom GameResult and GameError types to help with common game conditions.
17
18pub mod dice;
19pub use dice::{DicePool, Die};
20
21pub mod cards;
22pub use cards::{
23 AddCard, Card, CardCollection, CardFaces, CardHand, Deck, Hand, Pile, Rank, Suit, TakeCard,
24};
25
26pub mod dominos;
27pub use dominos::{BonePile, Domino, DominoHand, MAX_PIPS, Train};
28
29pub mod spinners;
30pub use spinners::{Spinner, Wedge, wedges_from_tuples, wedges_from_values};
31
32pub mod gameerror;
33pub use gameerror::GameError;
34
35pub type GameResult<T> = Result<T, GameError>;