mwg API
    Preparing search index...

    Class Campaign<State, Result>

    Game-neutral level sequencing and carry-over state. A campaign adapter supplies the actual level runner and decides what a level result means; MWG only preserves order, transitions, reminders and serialisable state.

    import { Campaign } from '@datamoc/mw_games/simulation';
    const campaign = new Campaign({
    levels: [{ id: 'intro', run: (state) => ({ outcome: 'completed', state, next: null }) }],
    start: 'intro', state: { gold: 0 },
    });
    campaign.completeCurrent({ outcome: 'completed', state: { gold: 10 }, next: null });

    Type Parameters

    Index