/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, typeCast, markType } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { StopInfo } from "./StopInfo";
import { CellFillLinearGradient } from "./CellFillLinearGradient";
import { CellFillRectangularGradient } from "./CellFillRectangularGradient";
import { CellFill } from "./CellFill";
/**
 * @hidden
 */
export class GradientFillInfo extends Base {
    constructor() {
        super(...arguments);
        this.g = new List$1(StopInfo.$, 0);
        this.i = 0;
        this.v = 0;
        this.t = 0;
        this.r = 0;
        this.p = 0;
        this.d = 0;
    }
    equals(a) {
        if (Base.referenceEquals(this, a)) {
            return true;
        }
        let b = typeCast(GradientFillInfo.$, a);
        if (b == null) {
            return false;
        }
        if (this.i != b.i || this.p != b.p || this.d != b.d || this.r != b.r || this.t != b.t || this.v != b.v || this.g.count != b.g.count) {
            return false;
        }
        for (let c = 0; c < this.g.count; c++) {
            if (Base.equalsStatic(this.g._inner[c], b.g._inner[c]) == false) {
                return false;
            }
        }
        return true;
    }
    getHashCode() {
        let a = (this.i) ^ (this.v) ^ (this.t) ^ (this.r) ^ (this.p) ^ Base.getHashCodeStatic(this.d) ^ this.g.count;
        if (this.g.count != 0) {
            a ^= this.g._inner[0].getHashCode();
            a ^= this.g._inner[this.g.count - 1].getHashCode();
        }
        return a;
    }
    get h() {
        return this.g;
    }
    get j() {
        return this.i;
    }
    set j(a) {
        this.i = a;
    }
    get w() {
        return this.v;
    }
    set w(a) {
        this.v = a;
    }
    get s() {
        return this.r;
    }
    set s(a) {
        this.r = a;
    }
    get u() {
        return this.t;
    }
    set u(a) {
        this.t = a;
    }
    get q() {
        return this.p;
    }
    set q(a) {
        this.p = a;
    }
    get e() {
        return this.d;
    }
    set e(a) {
        this.d = a;
    }
    static b(a, b) {
        let c = new GradientFillInfo();
        for (let d = 0; d < b.stops.count; d++) {
            c.h.add(StopInfo.d(a, b.stops.item(d)));
        }
        let e = typeCast(CellFillLinearGradient.$, b);
        let f = typeCast(CellFillRectangularGradient.$, b);
        if (e != null) {
            c.e = 0;
            c.q = e.angle;
        }
        else if (f != null) {
            c.e = 1;
            c.j = f.bottom;
            c.s = f.left;
            c.u = f.right;
            c.w = f.top;
        }
        else {
        }
        return c;
    }
    a(a) {
        let b = new Array(this.h.count);
        for (let c = 0; c < b.length; c++) {
            b[c] = this.h._inner[c].a(a);
        }
        switch (this.e) {
            case 0: return CellFill._createLinearGradientFill(this.q, ...b);
            case 1: return CellFill._createRectangularGradientFill1(this.s, this.w, this.u, this.j, ...b);
            default: return null;
        }
    }
}
GradientFillInfo.$t = markType(GradientFillInfo, 'GradientFillInfo');
//# sourceMappingURL=GradientFillInfo.js.map