import { ValueRuleCell } from "./ValueRuleCell";
import { ResultCell } from "../Common/ResultCell";
import { DataUtilities } from "../../../Common/DataUtilities";
export class ValueRuleRow {
    constructor() {
        this._id = DataUtilities.generateUniqueId();
        this.cellData = {};
        this.resultCellsData = {};
    }
    get cells() {
        return Object.values(this.cellData);
    }
    get resultCells() {
        return Object.values(this.resultCellsData);
    }
    getStorageData() {
        let d = {};
        let cells = [];
        for (let c of this.cells) {
            cells.push(c.getStorageData());
        }
        Reflect.set(d, "cells", cells);
        let rcells = [];
        for (let c of this.resultCells) {
            rcells.push(c.getStorageData());
        }
        Reflect.set(d, "rcells", rcells);
        return d;
    }
    setStorageData(data) {
        let cells = Reflect.get(data, "cells");
        for (let c of cells) {
            let newCell = new ValueRuleCell("tempid");
            newCell.setStorageData(c);
            this.cellData[Reflect.get(c, "_columnId")] = newCell;
        }
        let rcells = Reflect.get(data, "rcells");
        for (let c of rcells) {
            let newCell = new ResultCell("tempid");
            newCell.setStorageData(c);
            this.resultCellsData[Reflect.get(c, "_columnId")] = newCell;
        }
    }
}
//# sourceMappingURL=ValueRuleRow.js.map