INNER CODE UNIT · TypeScript
dt
akirarika/milkio · packages/cookbook/src/progress/index.ts:53
const dt = RENDER_INTERVAL / 1000;
for (const state of progress.scopes.values()) {
if (state.activeStage) {
state.activeStage.creep += (1 - state.activeStage.creep) * CREEP_K * dt;
state.activeStage.creep = Math.min(state.activeStage.creep, 0.995);
}
}
progress.update();
}, RENDER_INTERVAL);
},
configure(options: { totalUnits: number }) {
progress.usingStages = options.totalUnits > 0;
progress.totalUnits = options.totalUnits;
progress.scopes = new Map();
},
stage(scope: string, name: string, weight: number) {