import { Rectangle } from "../../../../pixi/pixi.mjs";
import { SceneObject } from "../../../SceneObjects/SceneObject";
import { getSpriteFromAtlas } from "../../../Utils/Sprites.utils";

export class TerrainTileProps
{
    /**
     * @type String
     */
    type;
    /**
     * @type Number
     */
    temperature;

    /**
     * 
     * @param {String} type 
     * @param {Number} temperature 
     */
    constructor(type = "", temperature = 0)
    {
        this.type = type;
        this.temperature = temperature;
    };


}

export class TerrainTile extends SceneObject
{
    props = new TerrainTileProps();
    spriteSheetPath = "";
    frame = new Rectangle();

    #printed = false;

    onInit()
    {
        super.onInit();
        this.drawObject = getSpriteFromAtlas(this.spriteSheetPath, this.frame);
    };

    tick(ticker)
    {
        if(!this.#printed)
        {
            console.log(this.props);
            this.#printed = true;
        }
    }
};