From cc8ea2053689c4757a28ca13423ad964d531748b Mon Sep 17 00:00:00 2001 From: Tom Boullay Date: Mon, 11 May 2026 11:51:06 +0200 Subject: [PATCH] update: stabilize repair mission stage mounting --- src/world/GameStageContent.tsx | 50 ++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/src/world/GameStageContent.tsx b/src/world/GameStageContent.tsx index d5d3b79..e18be89 100644 --- a/src/world/GameStageContent.tsx +++ b/src/world/GameStageContent.tsx @@ -1,5 +1,6 @@ import { RepairGame } from "@/components/three/gameplay/RepairGame"; import { useGameStore } from "@/managers/stores/useGameStore"; +import type { RepairMissionId } from "@/types/gameplay/repairMission"; import type { Vector3Tuple } from "@/types/three/three"; interface StageAnchorProps { @@ -8,6 +9,26 @@ interface StageAnchorProps { scale?: number; } +interface GameRepairZone { + mission: RepairMissionId; + position: Vector3Tuple; +} + +const GAME_REPAIR_ZONES = [ + { + mission: "bike", + position: [8, 0, -6], + }, + { + mission: "pylone", + position: [64, 0, -66], + }, + { + mission: "ferme", + position: [-24, 0, 42], + }, +] as const satisfies readonly GameRepairZone[]; + function StageAnchor({ color, position, @@ -30,16 +51,21 @@ function StageAnchor({ export function GameStageContent(): React.JSX.Element { const mainState = useGameStore((state) => state.mainState); - switch (mainState) { - case "intro": - return ; - case "bike": - return ; - case "pylone": - return ; - case "ferme": - return ; - case "outro": - return ; - } + return ( + <> + {mainState === "intro" ? ( + + ) : null} + {GAME_REPAIR_ZONES.map((zone) => ( + + ))} + {mainState === "outro" ? ( + + ) : null} + + ); }