import { assert } from "../../core/assert.js";
import { CellFilterLiteralFloat } from "../filtering/numeric/CellFilterLiteralFloat.js";
import { TerrainLayerDescription } from "./TerrainLayerDescription.js";

export class TerrainLayerRule {
    /**
     *
     * @type {CellFilter}
     */
    filter = CellFilterLiteralFloat.from(1);

    /**
     *
     * @type {TerrainLayerDescription}
     */
    layer = new TerrainLayerDescription();


    /**
     *
     * @param {CellFilter} filter
     * @param {TerrainLayerDescription} layer
     * @returns {TerrainLayerRule}
     */
    static from(filter, layer) {

        assert.equal(filter.isCellFilter, true, 'filter.isCellFilter');
        assert.equal(layer.isTerrainLayerDescription, true, 'layer.isTerrainLayerDescription');

        const r = new TerrainLayerRule();

        r.filter = filter;
        r.layer = layer;

        return r;
    }
}
