UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

53 lines (42 loc) 775 B
export class SystemEntityContext { /** * * @type {number} */ entity = -1; /** * Pointer back to the system * @type {System} */ system = null; /** * * @type {*[]} */ components = []; /** * * @type {boolean} * @protected */ __is_linked = false; /** * * @returns {EntityComponentDataset} */ getDataset() { return this.system.entityManager.dataset; } link() { if (this.__is_linked) { return; } this.__is_linked = true; } unlink() { if (!this.__is_linked) { return; } this.__is_linked = false; } }