import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { ECSEntity } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECSEntity";
import { PathFindComp } from "../../common/ecs/path/PathFind";
import { PuppetModelComp } from "../model/PuppetModelComp";
import { Puppet } from "../puppet";

/**
 * 第一行是否
 */
@ecs.register('PuppetPath')
export class PuppetPathComp extends ecs.Comp {

    reset() {

    }
}

export class PuppetPathSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {

    filter(): ecs.IMatcher {
        return ecs.allOf(PathFindComp, PuppetModelComp);
    }


    update(e: Puppet): void {
        // console.log(e.PathFind)
        // console.log('人物寻路')
        if (e.PathFind && e.PathFind.canReach) {
            // if (e.PuppetModel.x === 0) {
            //     console.log('当前是否可到达', e.PathFind.canReach)
            //     console.log('当前格子序号', e.PuppetModel.x, e.PuppetModel.y)
            //     console.log('当前路径', e.PathFind.path)
            // }

        }
    }
}