"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChannelModelObject = void 0;
exports.makeChannelModelObject = makeChannelModelObject;
const core_1 = require("@vived/core");
const Label_1 = require("../../Label");
class ChannelModelObject extends core_1.AppObjectEntity {
    static get(id, appObjects) {
        const appObject = appObjects.get(id);
        if (!appObject) {
            appObjects.submitWarning("ChannelModelObject.get", "Unable to find app object by ID");
            return;
        }
        return appObject.getComponent(ChannelModelObject.type);
    }
}
exports.ChannelModelObject = ChannelModelObject;
ChannelModelObject.type = "ChannelModelObject";
function makeChannelModelObject(appObject) {
    return new ChannelModelObjectImp(appObject);
}
class ChannelModelObjectImp extends ChannelModelObject {
    get id() {
        return this.appObject.id;
    }
    get tags() {
        return [...this._tags];
    }
    set tags(val) {
        this._tags = [...val];
        this.notifyOnChange();
    }
    get subMeshPaths() {
        return [...this._subMeshes];
    }
    set subMeshPaths(val) {
        this._subMeshes = [...val];
        this.notifyOnChange();
    }
    constructor(appObject) {
        super(appObject, ChannelModelObject.type);
        this._tags = [];
        this._subMeshes = [];
        this.label = (0, Label_1.makeLabelEntity)(appObject);
        this.label.addChangeObserver(this.notifyOnChange);
    }
}
//# sourceMappingURL=ChannelModelObject.js.map