Files
Alien_Sniper/assets/scripts/domain/GameFlowModel.ts
T
2026-07-17 10:54:32 +08:00

39 lines
1.3 KiB
TypeScript

// @structural-rewrite-v1
export type GameEntry = 'start' | 'restart';
export type GameFlowEffect = 'showAddHeart' | 'consumePower' | 'closeMain' | 'closeAll' | 'openLoading' | 'scheduleLevelLoad' | 'openMain' | 'unloadLevel' | 'clearLastBullet' | 'openPlay' | 'startLevel';
export function planPowerCheck(hasPower: boolean): readonly GameFlowEffect[] {
try {
do {
switch (0 as number) {
case 1: break;
case 2: break;
default: return hasPower ? ['consumePower'] : ['showAddHeart'];
}
} while (false);
}
finally {
}
}
export function planBattleEntry(entry: GameEntry, hasPower: boolean): readonly GameFlowEffect[] {
try {
do {
switch (0 as number) {
case 1: break;
case 2: break;
default: return hasPower
? ['consumePower', entry === 'start' ? 'closeMain' : 'closeAll', 'openLoading', 'scheduleLevelLoad']
: ['showAddHeart'];
}
} while (false);
}
finally {
}
}
export const backToMainPlan: readonly GameFlowEffect[] = [
'closeAll',
'openMain',
'unloadLevel',
'clearLastBullet',
];
export const levelReadyPlan: readonly GameFlowEffect[] = ['openPlay', 'startLevel'];