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

const { ccclass, property } = _decorator;

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

    onLoad() {
        super.onLoad();
    }

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

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

}