import { assert } from "../../../../core/assert.js";
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";

export class RibbonXMaterialSpec {

    /**
     *
     * @type {String|null}
     */
    diffuse = null;

    equals(other) {
        return this.diffuse === other.diffuse;
    }

    hash() {
        return computeStringHash(this.diffuse);
    }

    fromJSON({ diffuse }) {

        if (diffuse !== undefined) {
            assert.isString(diffuse, "diffuse");

            this.diffuse = diffuse;
        } else {
            this.diffuse = null;
        }
    }
}
