import { Container } from "pixi.js";
import { Layer } from "@pixi/layers";
/**
 * RoomObjectLayer class that manage all the room objects.
 *
 * @class
 * @memberof Scuti
 */
export class RoomObjectLayer extends Container {
    /**
     * @param {Room} [room] - The room instance that we want to visualize.
     */
    constructor(room) {
        super();
        /**
         * The object layer.
         *
         * @member {Layer}
         * @private
         */
        this._layer = new Layer();
        this._room = room;
        this._room.engine.application.stage.addChild(this._layer);
        this._layer.group.enableSort = true;
        this._layer.zIndex = 1000;
    }
    /**
     * Add the given room object into the object layer of the room.
     *
     * @param {RoomObject} [object] - The room object that we want to add.
     * @return {void}
     * @public
     */
    add(object) {
        object.room = this._room;
        object.start();
        this.addChild(object);
    }
    /**
     * Remove the given room object into the object layer of the room.
     *
     * @param {RoomObject} [object] - The room object that we want to remove.
     * @return {void}
     * @public
     */
    remove(object) {
        object.stop();
        this.removeChild(object);
    }
    /**
     * Reference to the pixi layer.
     *
     * @member {Layer}
     * @readonly
     * @public
     */
    get layer() {
        return this._layer;
    }
}
//# sourceMappingURL=RoomObjectLayer.js.map