Expand description
§HerdingCats
A deterministic, turn-based game engine where an ordered set of statically known behaviors resolves every input unambiguously.
§Quick Start
- Define your game types and bundle them into an
EngineSpecimpl. - Define
BehaviorDefentries — plain structs with fn pointer fields. - Construct an
Engineand calldispatch(input, reversibility).
All public types are re-exported at the crate root.
Structs§
- Behavior
Def - A single rule in the game, expressed as a plain struct with fn pointer fields.
- Engine
- The HerdingCats dispatch engine.
- Frame
- The canonical committed record of a single dispatch transition.
Enums§
- Behavior
Result - The result returned by a single
BehaviorDefevaluate call. - Engine
Error - Unrecoverable engine-level errors, distinct from normal
Outcomevariants. - History
Disallowed - The reason an undo or redo call was disallowed.
- NonCommitted
Outcome - A non-committed outcome explicitly chosen by a
BehaviorDefevaluate fn. - Outcome
- The result of a single
dispatch,undo, orredocall. - Reversibility
- Declares whether a dispatch transition may be undone.
Traits§
- Apply
- Applies this diff to the working state and returns trace entries generated by this mutation.
- Engine
Spec - Bundles all game-specific associated types behind a single type parameter, eliminating generic explosion in function signatures.
Type Aliases§
- Behavior
Eval - Type alias for the evaluate fn pointer signature used by
BehaviorDef.