Skip to main content

Crate herdingcats

Crate herdingcats 

Source
Expand description

§HerdingCats

A deterministic, turn-based game engine where an ordered set of statically known behaviors resolves every input unambiguously.

§Quick Start

  1. Define your game types and bundle them into an EngineSpec impl.
  2. Define BehaviorDef entries — plain structs with fn pointer fields.
  3. Construct an Engine and call dispatch(input, reversibility).

All public types are re-exported at the crate root.

Structs§

BehaviorDef
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§

BehaviorResult
The result returned by a single BehaviorDef evaluate call.
EngineError
Unrecoverable engine-level errors, distinct from normal Outcome variants.
HistoryDisallowed
The reason an undo or redo call was disallowed.
NonCommittedOutcome
A non-committed outcome explicitly chosen by a BehaviorDef evaluate fn.
Outcome
The result of a single dispatch, undo, or redo call.
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.
EngineSpec
Bundles all game-specific associated types behind a single type parameter, eliminating generic explosion in function signatures.

Type Aliases§

BehaviorEval
Type alias for the evaluate fn pointer signature used by BehaviorDef.