import { _decorator } from "cc";
import { PropBase } from "./PropBase";
import { Snake } from "db://assets/Scripts/Scenes/MainGame/Snake";
import { CardManager } from "../Manager/CardManager";

const { ccclass, property } = _decorator;

@ccclass("Magnet")
export class Magnet extends PropBase {

    onLoad() {
        super.onLoad();
    }

    beEaten = (target: Snake) => {
        target.useMagnet();
    };

    recycle() {
        super.recycle();
        CardManager.ins.check();
        this.node.removeFromParent();
        this.node.destroy();
        // propPool.put(this.node);
    }

}