import { Assets } from "pixi.js";
import { FloorFurniture } from "./FloorFurniture";
import { WallFurniture } from "./WallFurniture";
/**
 * FurnitureData class that manage the data of a furniture.
 *
 * @class
 * @memberof Scuti
 */
export class FurnitureData {
    /**
     * @param {FloorFurniture | WallFurniture} [furniture] - The furniture instance.
     */
    constructor(furniture) {
        this._furniture = furniture;
        this._load();
    }
    /**
     * Load the furniture data.
     *
     * @return {void}
     * @private
     */
    _load() {
        if (this._furniture instanceof FloorFurniture) {
            this._data = Assets.get('furnitures/furnidata').floorItems.find(item => item.id === this._furniture.id);
        }
        else if (this._furniture instanceof WallFurniture) {
            this._data = Assets.get('furnitures/furnidata').wallItems.find(item => item.id === this._furniture.id);
        }
    }
    /**
     * Reference to the furniture id.
     *
     * @member {number}
     * @readonly
     * @public
     */
    get id() {
        return this._data.id;
    }
    /**
     * Reference to the furniture class name.
     *
     * @member {string}
     * @readonly
     * @public
     */
    get className() {
        return this._data.className;
    }
    /**
     * Reference to the furniture base name.
     *
     * @member {string}
     * @readonly
     * @public
     */
    get baseName() {
        if (!this._data.className.includes("*"))
            return this._data.className;
        return this._data.className.split("*")[0];
    }
    /**
     * Reference to the furniture color id.
     *
     * @member {number}
     * @readonly
     * @public
     */
    get color() {
        if (!this._data.className.includes("*"))
            return null;
        return Number(this._data.className.split("*")[1]);
    }
}
//# sourceMappingURL=FurnitureData.js.map