import BehaviorNode, { BehaviorNodeType } from "../behavior/BehaviorNode";
import BehaviorTree from "../behavior/BehaviorTree";

export default class BehaviorDead extends BehaviorNode {

    constructor(behaviorTree:BehaviorTree){
        super(behaviorTree);
        this.type = BehaviorNodeType.Action
    }

    public isOK():boolean{
        return true
    }
    /**
     * 执行当前节点
     * @param callback 执行结束后回调
     */
    public run(callback:(behaviorNode)=>void){
        let sprite = this.behaviorTree.sprite
        sprite.dead()
        callback(null)
    }
}
