import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { VM } from "../../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel";





@ecs.register('CheckpointModelBase')
export class CheckpointModelBaseComp extends ecs.Comp {
    
    /** 提供 VM 组件使用的数据 */
    vm: CheckpointBaseVM = new CheckpointBaseVM();

    vmAdd() {
        VM.add(this.vm, "CheckpointBase");
    }

    vmRemove() {
        this.vm.reset();
        VM.remove("CheckpointBase");
    }

    reset() {
        this.vmRemove();
    }
}

class CheckpointBaseVM {
     
    /** 添加格子使用次数 */
    addCellCount: number = 0;
    /** 清理站台使用数 */
    clearCount: number = 0;
    /** 直接开走使用数 */
    leaveCount: number = 0;

    reset() {
        this.addCellCount = 0;
        this.clearCount = 0;
        this.leaveCount = 0;
    }
}