"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Utilities_1 = require("../core/Utilities");
class ManagedFilterClauseOrFilterClauseSet {
    _data;
    constructor(data) {
        this._data = data;
    }
    get test() {
        if (!this._data) {
            return undefined;
        }
        return this._data.test;
    }
    get operator() {
        if (!this._data) {
            return undefined;
        }
        return this._data.operator;
    }
    get subject() {
        if (!this._data) {
            return undefined;
        }
        return this._data.subject;
    }
    get value() {
        if (!this._data) {
            return undefined;
        }
        return this._data.value;
    }
    get anyOf() {
        if (!this._data) {
            return undefined;
        }
        const anyOfData = this._data.any_of;
        if (!anyOfData) {
            return undefined;
        }
        let anyOfs = [];
        for (const dataNode of anyOfData) {
            anyOfs.push(new ManagedFilterClauseOrFilterClauseSet(dataNode));
        }
        return anyOfs;
    }
    get allOf() {
        if (!this._data) {
            return undefined;
        }
        const allOfData = this._data.all_of;
        if (!allOfData) {
            return undefined;
        }
        let allOfs = [];
        for (const dataNode of allOfData) {
            allOfs.push(new ManagedFilterClauseOrFilterClauseSet(dataNode));
        }
        return allOfs;
    }
    getHumanSummary() {
        let results = "";
        if (this.anyOf) {
            results += "Any condition must match:";
            for (const anyOfNode of this.anyOf) {
                results += anyOfNode.getHumanSummary();
            }
        }
        else if (this.allOf) {
            results += "All conditions must match:";
            for (const allOfNode of this.allOf) {
                results += allOfNode.getHumanSummary();
            }
        }
        else if (this.test) {
            results += Utilities_1.default.humanifyMinecraftName(this.test);
            if (this.operator) {
                results += " " + this.operator;
            }
            if (this.value) {
                results += " " + this.value;
            }
        }
        return results;
    }
}
exports.default = ManagedFilterClauseOrFilterClauseSet;

//# sourceMappingURL=../maps/minecraft/ManagedFilterClauseOrFilterClauseSet.js.map
