@pretty-chitty/core
    Preparing search index...

    Interface Game<P, R>

    Core entry point for a pretty-chitty game. This needs to ultimately provide:

    • A way to generate players
    • A way to generate the root chit
    • An async run method to actually execute the game logic
    • A library of chits, buttons and canvases

    See documentation on Turn for more details on how to structure your game logic.

    interface Game<P extends PlayerChit, R extends RootChit<P>> {
        get theme(): GameTheme;
        get name(): string;
        get chitLibrary(): IChitLibrary<P, R>;
        get canvasLibrary(): ICanvasLibrary;
        get buttonLibrary(): IButtonLibrary;
        tokenMap?: { [key: string]: TokenDefinition };
        run(setup: Turn<GameResult<P>, P, R>, rootChit: R): Promise<GameResult<P>>;
        renderDefaultRootChit?(spec: ChitRenderSpec): void;
    }

    Type Parameters

    Index

    Accessors

    Methods

    Properties

    tokenMap?: { [key: string]: TokenDefinition }