chore:代码重构
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// @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'];
|
||||
Reference in New Issue
Block a user