import { _decorator, Component, Node } from 'cc';
import { TempCup } from './TempCup';
const { ccclass, property } = _decorator;

@ccclass('TempCups')
export class TempCups extends Component {
    start() {

    }

    /** 查找暂存区空杯*/
    findAvailableTempCup(): TempCup | null {
        // 添加空值检查和类型过滤
        return this.node.children
            .map(node => node.getComponent(TempCup))
            .find(cup => cup && !cup.isFull) || null;
    }

    update(deltaTime: number) {

    }
}


