How to use the oni-save-parser.parseSaveGame function in oni-save-parser

To help you get started, we’ve selected a few oni-save-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RoboPhred / oni-duplicity / src / services / oni-save / save-serializer.worker.ts View on Github external
function parseSave(command: ParseSaveCommand) {
  const injector = progressReporter(onProgress);

  try {
    const save = parseSaveGame(command.data, injector);
    postMessage(parseSaveSuccess(save));
  } catch (e) {
    postMessage(parseSaveError(e));
  }
}
github RoboPhred / oni-duplicity / src / services / save-editor / save-loader.worker.ts View on Github external
function doLoad(data: LoadCommandData) {
  try {
    const saveGame = parseSaveGame(data.buffer);
    const msg: DataLoadedEvent = {
      type: "loaded",
      saveGame: saveGame
    };
    postMessage(msg);
  } catch (e) {
    const msg: DataLoadedEvent = {
      type: "loaded",
      error: e,
      saveGame: null
    };
    postMessage(msg);
  }
}
github RoboPhred / oni-duplicity / src / services / save-serializer / save-serializer.worker.ts View on Github external
function parseSave(command: ParseSaveCommand) {
  const injector = progressReporter(onProgress);

  try {
    const save = parseSaveGame(command.data, injector);
    postMessage(parseSaveSuccess(save));
  } catch (e) {
    postMessage(parseSaveError(e));
  }
}