refactor: organize three components by domain

This commit is contained in:
Tom Boullay
2026-04-30 11:35:53 +02:00
parent ab8376b03e
commit 081e87c96d
30 changed files with 465 additions and 327 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ if (debug.active) {
r3f-perf is loaded only in debug mode to avoid dependency issues in production:
```tsx
// src/utils/debug/DebugPerf.tsx
// src/components/debug/DebugPerf.tsx
import { Suspense, lazy } from "react";
import { Debug } from "@/utils/debug/Debug";
+7 -6
View File
@@ -28,12 +28,13 @@ export class SomeManager {
## Managers in this project
| Manager | File | Role |
| ------------------ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `GameManager` | `src/stateManager/GameManager.ts` | Single source of truth. Owns phase, zone, mission, input lock, dialogue. Has `subscribe()` + `getState()`. |
| `CinematicManager` | `src/stateManager/CinematicManager.ts` | GSAP timelines. Locks/unlocks input via GameManager. |
| `AudioManager` | `src/stateManager/AudioManager.ts` | Music, SFX, spatial audio. Reads phase from GameManager. |
| `ZoneManager` | `src/stateManager/ZoneManager.ts` | Zone entry/exit detection, LOD triggers. Notifies GameManager of zone changes. |
| Manager | File | Role |
| -------------------- | ------------------------------------ | ----------------------------------------------------------------------------- |
| `AudioManager` | `src/managers/AudioManager.ts` | Music and SFX playback. |
| `InteractionManager` | `src/managers/InteractionManager.ts` | Focus, nearby, trigger, grab, and hand-grab interaction state. |
| `GameManager` | target-state only | Future single source of truth for phase, zone, mission, input lock, dialogue. |
| `CinematicManager` | target-state only | Future GSAP timeline orchestrator. |
| `ZoneManager` | target-state only | Future zone entry/exit detection and LOD triggers. |
## GameManager is the orchestrator