@Cards-TS
    Preparing search index...

    Module @cards-ts/state-machine

    @cards-ts/state-machine

    GitHub Latest Commit Documentation

    This is a card game framework written in Typescript. This package contains functionality to allow for simple creation and composition of state machines for the games.

    Contributions of games to the library are welcome on the Github.

    We use SemVer for versioning. For the versions available, see the tags on this repository.

    See also the list of contributors who participated in this project.

    Type Aliases

    Machine
    MachineLike
    NamedMachineLike
    NestedMachine

    Functions

    adapt

    Adapts a state machine into a flat model for backwards compatibility with the old way of creating the game states

    conditionalState

    Generates a state machine that branches into two other state machines based on a runtime check

    game

    Generates the top level machine using the start / end states currently expected by the framework with game state transitions

    handleAll

    Creates a machine that calls all handlers at the same time

    handleRoundRobin

    Creates a machine that calls each player in order

    handleRoundRobinFirst

    Creates a machine that calls each player in turn looking for a certain response (e.g. whether they would like a card or not)

    handleSingle

    Creates a machine (or transition) that calls a single player

    loop

    Creates a machine that loops the run machine until the condition is met

    named
    sequence

    Combines multiple machines into a sequence that will be called one by one