import { assert } from "../../../../../core/assert.js";

export class ParticleRenderCommand {

    /**
     * How to render
     * @type {ParticleRenderSpecification}
     */
    spec = null;

    /**
     * What to render
     * @type {EmitterAttributeData}
     */
    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;
    }
}
