Simulation

Assets/Scripts/Rokojori/Simulation - the turn loop that drives GamePhases. The least finished of the three systems - see outline/tech/index.page for what's still missing.

The Turn Loop

SimulationManager.Run():
intro → while not finished: preTurn → playerTurn ×playerCount → postTurn → (loop) → outro.

Each list is run by RunPhases(), which executes phases in order and checks phase.gameFinished after each one. If any phase sets it, RunPhases returns immediately (skipping the rest of that list) and Run() skips straight to outro instead of continuing the while-loop.

playerCount Is a Placeholder

There is no Player type anywhere in the codebase yet. SimulationManager.playerCount is a plain int defaulting to 1 - nothing currently sets it automatically. An intro phase is expected to set it (e.g. from a GameState variable) before the turn loop needs it, but that phase doesn't exist yet either.

GamePhase

Abstract ScriptableObject. Execute( GameStateManager, SimulationRenderer ) does the work; set gameFinished = true from inside it to end the game early. No concrete example phases exist yet (ShowTurnStartConditions / SimulateWorld were only described narratively in the outline, no code contract given).

SimulationRenderer / SimulationCommand - Stubs

SimulationRenderer.Enqueue( command ) currently just returns Task.CompletedTask immediately - there's no rendering/animation pipeline behind it. SimulationCommand is an empty abstract base with no concrete commands defined. A GamePhase can call Enqueue today and it will compile and "work" (complete instantly), but nothing will actually happen on screen.

DialogPhase

Lives here, not in Dialog/, because it's a GamePhase, not part of the dialog engine itself. Just awaits DialogManager.instance.StartDialog( start ) - all real logic stays in Dialog/.