import { TMRUtility } from "../tmr-utility.js";
import { Draconique } from "./draconique.js";
import { PixiTMR } from "./pixi-tmr.js";

export class CarteTmr extends Draconique {

  type() { return '' }
  match(item) { return false; }
  manualMessage() { return false }
  async onActorCreateOwned(actor, item) { }

  code() { return 'tmr' }
  img() { return 'systems/foundryvtt-reve-de-dragon/styles/img/ui/tmr.webp' }

  createSprite(pixiTMR) {
    const img = PixiTMR.getImgFromCode(this.code())
    const sprite = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
    // Setup the position of the TMR
    sprite.x = pixiTMR.pixiApp.screen.x;
    sprite.y = pixiTMR.pixiApp.screen.y;
    sprite.width = pixiTMR.pixiApp.screen.width;
    sprite.height = pixiTMR.pixiApp.screen.height;
    // Rotate around the center
    sprite.anchor.set(0);
    sprite.buttonMode = true;
    sprite.tmrObject = pixiTMR;
    return sprite;
  }


}