UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

38 lines (29 loc) 913 B
import { assert } from "../../../../../core/assert.js"; export class ParticleRenderCommand { constructor() { /** * How to render * @type {ParticleRenderSpecification} */ this.spec = null; /** * What to render * @type {EmitterAttributeData} */ this.data = null; } /** * * @param {ParticleRenderSpecification} spec * @param {EmitterAttributeData} data * @returns {ParticleRenderCommand} */ static from(spec, data) { assert.equal(spec.isParticleRenderSpecification, true, 'spec.isParticleRenderSpecification !== true'); assert.equal(data.isEmitterAttributeData, true, 'data.isEmitterAttributeData !== true'); const r = new ParticleRenderCommand(); r.spec = spec; r.data = data; return r; } }