update: add generic repair mission store helpers

This commit is contained in:
Tom Boullay
2026-05-08 01:09:42 +01:00
parent b0bb127459
commit 118e5f3b4a
4 changed files with 95 additions and 54 deletions
+12
View File
@@ -114,6 +114,18 @@ setMainState("bike");
Direct setters are useful for debug panels, but production gameplay should prefer business actions such as `advanceGameState`, `completeBike`, or `completePylone`.
Mission gameplay that can target `bike`, `pylone`, or `ferme` should prefer the generic mission actions:
```ts
const setMissionStep = useGameStore((state) => state.setMissionStep);
const completeMission = useGameStore((state) => state.completeMission);
setMissionStep("bike", "inspected");
completeMission("bike");
```
This keeps reusable gameplay components such as repair flows from duplicating mission-specific branches like `setBikeState`, `setPyloneState`, and `setFermeState`.
## World Integration
`src/world/GameStageContent.tsx` subscribes to `mainState` and mounts stage-specific content.