"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProjectionAttributeStateSet = void 0;
const internal_1 = require("../../internal");
/**
 * A collection of ProjectionAttributeState objects
 * @internal
 */
class ProjectionAttributeStateSet {
    /**
     * Create a new empty state
     */
    constructor(ctx) {
        this.TAG = ProjectionAttributeStateSet.name;
        this.ctx = ctx;
        this.states = [];
    }
    /**
     * Add to the collection
     * @internal
     */
    add(pas) {
        if (!pas || !pas.currentResolvedAttribute || !pas.currentResolvedAttribute.resolvedName) {
            internal_1.Logger.error(this.ctx, this.TAG, this.add.name, undefined, internal_1.cdmLogCode.ErrProjInvalidAttrState);
        }
        else {
            this.states.push(pas);
        }
    }
    /**
     * Creates a copy of this projection attribute state set
     */
    copy() {
        const copy = new ProjectionAttributeStateSet(this.ctx);
        for (const state of this.states) {
            copy.states.push(state);
        }
        return copy;
    }
    /**
     * Check if exists in collection
     * @internal
     */
    contains(pas) {
        return this.states.includes(pas);
    }
}
exports.ProjectionAttributeStateSet = ProjectionAttributeStateSet;
//# sourceMappingURL=ProjectionAttributeStateSet.js.map