UNPKG

dcl-npc-toolkit-ai-version

Version:

A collection of tools for creating Non-Player-Characters (NPCs). These are capable of having conversations with the player, and play different animations. AI usage is added atop of it

23 lines 827 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dumpChanges = void 0; function dumpChanges(schema) { const changeTrees = [schema['$changes']]; let numChangeTrees = 1; const dump = {}; let currentStructure = dump; for (let i = 0; i < numChangeTrees; i++) { const changeTree = changeTrees[i]; changeTree.changes.forEach((change) => { const ref = changeTree.ref; const fieldIndex = change.index; const field = (ref['_definition']) ? ref['_definition'].fieldsByIndex[fieldIndex] : ref['$indexes'].get(fieldIndex); currentStructure[field] = changeTree.getValue(fieldIndex); }); } return dump; } exports.dumpChanges = dumpChanges; //# sourceMappingURL=utils.js.map