refactor: tick pipeline pattern — read all → compute all → write all (issue #103)
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s
- New tick-pipeline.ts: TickContext/TickWrites types + buildTickContext/applyTickWrites orchestrator
- gameStore.ts tick(): refactored to 3-phase pipeline (read snapshot → compute updates → batch writes)
- combat-actions.ts: accept signedPacts as parameter instead of usePrestigeStore.getState() in combat loop
- combatStore.ts/combat-state.types.ts: updated processCombatTick signature for signedPacts passthrough
- craftingStore.ts: removed tempState = { ...get(), rawMana } as any anti-pattern
- preparation-actions.ts: accept rawMana as explicit parameter instead of GameState bag
This commit is contained in:
@@ -223,6 +223,7 @@ export const useCombatStore = create<CombatState>()(
|
||||
attackSpeedMult: number,
|
||||
onFloorCleared: (floor: number, wasGuardian: boolean) => void,
|
||||
onDamageDealt: (damage: number) => { rawMana: number; elements: Record<string, { current: number; max: number; unlocked: boolean }> },
|
||||
signedPacts: number[],
|
||||
) => {
|
||||
return processCombatTick(
|
||||
get,
|
||||
@@ -233,6 +234,7 @@ export const useCombatStore = create<CombatState>()(
|
||||
attackSpeedMult,
|
||||
onFloorCleared,
|
||||
onDamageDealt,
|
||||
signedPacts,
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user