import { DataUtilities } from "../../../../Common/DataUtilities";
import { ResultCell } from "../../Common/ResultCell";
import { RuleTableCell } from "./RuleTableCell";
export class RuleTableRow {
    constructor() {
        this._id = DataUtilities.generateUniqueId();
        this.ruleCells = {};
        this.resultCellsData = {};
    }
    get cells() {
        return Object.values(this.ruleCells);
    }
    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 RuleTableCell("tempid");
            newCell.setStorageData(c);
            this.ruleCells[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=RuleTableRow.js.map