mwg API
    Preparing search index...

    Function encodeSave

    • Serialises a world to a versioned JSON snapshot.

      Parameters

      Returns string

      import { createWorld, encodeSave } from '@datamoc/mw_games/mwl';

      const snapshot = encodeSave(createWorld(), { version: 1 });
      console.log(typeof snapshot); // 'string'