mwg API
    Preparing search index...

    Class SupportLedger

    Stores persistent progress for a relationship between a specific pair of units. Pair order is ignored, so add('alice', 'bob', 1) and the reverse address one bond.

    import { SupportLedger, type SupportLevel } from '@datamoc/mw_games/actors';

    const levels: SupportLevel[] = [{ id: 'C', threshold: 10 }, { id: 'B', threshold: 30 }];
    const support = new SupportLedger(levels);

    support.add('hero', 'ally', 12); // proximity, a shared battle, whatever a game counts
    console.log(support.level('ally', 'hero')?.id); // 'C' - pair order does not matter
    Index