refactor: move mission flow state into game store
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-11 18:02:00 +02:00
parent 91ebea8d99
commit 2c3f0db65b
21 changed files with 461 additions and 188 deletions
@@ -1,5 +1,5 @@
import { InteractableObject } from "@/components/three/interaction/InteractableObject";
import { useMissionFlowStore } from "@/managers/stores/useMissionFlowStore";
import { useGameStore } from "@/managers/stores/useGameStore";
import { Debug } from "@/utils/debug/Debug";
import type { Vector3Tuple } from "@/types/three/three";
@@ -10,10 +10,10 @@ interface CentralObjectProps {
export function CentralObject({
position,
}: CentralObjectProps): React.JSX.Element {
const step = useMissionFlowStore((state) => state.step);
const setStep = useMissionFlowStore((state) => state.setStep);
const setCanMove = useMissionFlowStore((state) => state.setCanMove);
const showDialog = useMissionFlowStore((state) => state.showDialog);
const step = useGameStore((state) => state.missionFlow.step);
const setStep = useGameStore((state) => state.setFlowStep);
const setCanMove = useGameStore((state) => state.setCanMove);
const showDialog = useGameStore((state) => state.showDialog);
const debug = Debug.getInstance();
const handlePress = (): void => {
@@ -1,5 +1,5 @@
import { InteractableObject } from "@/components/three/interaction/InteractableObject";
import { useMissionFlowStore } from "@/managers/stores/useMissionFlowStore";
import { useGameStore } from "@/managers/stores/useGameStore";
import { Debug } from "@/utils/debug/Debug";
import type { Vector3Tuple } from "@/types/three/three";
@@ -10,8 +10,8 @@ interface VillageoisHelperObjectProps {
export function VillageoisHelperObject({
position,
}: VillageoisHelperObjectProps): React.JSX.Element {
const step = useMissionFlowStore((state) => state.step);
const setStep = useMissionFlowStore((state) => state.setStep);
const step = useGameStore((state) => state.missionFlow.step);
const setStep = useGameStore((state) => state.setFlowStep);
const debug = Debug.getInstance();
const handlePress = (): void => {