UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

51 lines (39 loc) 1.16 kB
import { assert } from "../../../core/assert.js"; export class StaticKnowledgeDataTableDescriptor { constructor() { /** * * @type {StaticKnowledgeDataTable} */ this.table = null; /** * * @type {String} */ this.id = null; /** * Path to where JSON data for the table can be found * @type {String} */ this.source = null; } /** * * @param {string} id * @param {string} source * @param {StaticKnowledgeDataTable} table * @returns {StaticKnowledgeDataTableDescriptor} */ static from(id, source, table) { assert.isString(id, 'id'); assert.isString(source, 'source'); assert.defined(table, 'table'); assert.notNull(table, 'table'); assert.equal(table.isStaticKnowledgeDataTable, true, 'table.isStaticKnowledgeDataTable !== true'); const r = new StaticKnowledgeDataTableDescriptor(); r.id = id; r.source = source; r.table = table; return r; } }