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

export class Tile extends SceneObject
{
    tileId = 0;
    spriteSheetPath = "";
    frame = new Rectangle();
    tileKey = "";
    zOrder = -1;
    navigationCost = -1;
    isObstacle = false;

    /**
     * 
     * @param {Boolean} tickable 
     * @param {PointInt2D} position 
     */
    constructor(tickable, position)
    {
        super(tickable);
        this.worldPosition = position;
    }

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