# sagiadi/the-next-interview-game architecture

> Architecture diagram of the GitHub repository sagiadi/the-next-interview-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sagiadi/the-next-interview-game
- Repository: https://github.com/sagiadi/the-next-interview-game

## Overview

The repository is a Unity 2D job-search game: the player explores a city, earns project points by solving puzzles, builds connections, manages distraction-related time loss, selects a job, and completes an interview whose result determines a win or loss. The README documents the main runtime interactions and event-driven UI; the graph preserves those stages and the interview evaluation layer. Source excerpts were limited to a story-build script, so runtime relationships below rely on README documentation, not inspected C# implementations. The separate Twine story is included as a documented companion capability.

Main entry points: [`Assets/Scripts/Game/GameSession.cs`](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/GameSession.cs) (Game session), [`Assets/Scripts/Player/PlayerInteractor.cs`](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerInteractor.cs) (Player interactor), [`Assets/Scripts/Interview/InterviewSession.cs`](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Interview/InterviewSession.cs) (Interview session), [`Assets/Scripts/Events`](https://github.com/sagiadi/the-next-interview-game/tree/main/Assets/Scripts/Events) (Event channels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["City gameplay"]
  node_input["Input reader"]
  node_movement["Player movement<br/>[PlayerMover.cs]"]
  node_sensor["Interaction sensor"]
  node_interactor["Player interactor"]
  node_puzzle["Puzzle station<br/>[PuzzleStation.cs]"]
  node_generator["Puzzle generator<br/>[PuzzleGenerator.cs]"]
  node_npc["Contact NPC<br/>[ContactNPC.cs]"]
  node_focus["Player focus<br/>[PlayerFocus.cs]"]
  node_distraction["Distraction<br/>[Distraction.cs]"]
  node_launcher["Distraction launcher"]
  node_jobboard["Job board<br/>[JobBoardZone.cs]"]
end

subgraph group_game["Game state"]
  node_session["Game session<br/>[GameSession.cs]"]
  node_timer["Round timer<br/>[RoundTimer.cs]"]
  node_rules["Round rules<br/>[RoundRules.cs]"]
  node_events["Event channels"]
end

subgraph group_interview["Interview"]
  node_interview_session["Interview session"]
  node_evaluator["Interview evaluator"]
end

subgraph group_presentation["Presentation and story"]
  node_screen["Interview screen<br/>[InterviewScreen.cs]"]
  node_hud["Round HUD<br/>[RoundHud.cs]"]
  node_panels["Gameplay panels"]
  node_twine["Twine companion story"]
  node_winlose["Win and loss scenes<br/>[Win.unity]"]
end

node_player(("Player"))

node_player -->|"provides controls"| node_input
node_input -->|"drives movement"| node_movement
node_movement -->|"provides facing"| node_sensor
node_input -.->|"signals interaction"| node_interactor
node_interactor -->|"uses target"| node_sensor
node_interactor -.->|"interacts"| node_puzzle
node_interactor -.->|"interacts"| node_npc
node_interactor -.->|"interacts"| node_jobboard
node_puzzle -.->|"requests puzzle"| node_generator
node_puzzle -->|"raises requests"| node_events
node_npc -.->|"adds connection"| node_session
node_npc -->|"raises message"| node_events
node_distraction -->|"causes focus loss"| node_focus
node_focus -->|"spends time"| node_session
node_launcher -->|"launches"| node_distraction
node_jobboard -->|"raises job request"| node_events
node_timer -->|"spends time"| node_session
node_session -.->|"signals time up"| node_rules
node_rules -.->|"loads loss scene"| node_winlose
node_session -.->|"publishes state"| node_hud
node_events -.->|"notifies listeners"| node_panels
node_interview_session -->|"scores answers"| node_evaluator
node_interview_session -->|"reads job and bonus"| node_session
node_screen -->|"submits answers"| node_interview_session
node_interview_session -.->|"publishes interview events"| node_screen

click node_input "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerInputReader.cs"
click node_movement "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerMover.cs"
click node_sensor "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/InteractionSensor.cs"
click node_interactor "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerInteractor.cs"
click node_puzzle "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/PuzzleStation.cs"
click node_generator "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Puzzle/PuzzleGenerator.cs"
click node_npc "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/ContactNPC.cs"
click node_focus "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerFocus.cs"
click node_distraction "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Obstacles/Distraction.cs"
click node_launcher "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Obstacles/DistractionLauncher.cs"
click node_jobboard "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/JobBoardZone.cs"
click node_session "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/GameSession.cs"
click node_timer "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/RoundTimer.cs"
click node_rules "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/RoundRules.cs"
click node_events "https://github.com/sagiadi/the-next-interview-game/tree/main/Assets/Scripts/Events"
click node_interview_session "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Interview/InterviewSession.cs"
click node_evaluator "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Interview/IInterviewEvaluator.cs"
click node_screen "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/UI/InterviewScreen.cs"
click node_hud "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/UI/RoundHud.cs"
click node_panels "https://github.com/sagiadi/the-next-interview-game/tree/main/Assets/Scripts/UI"
click node_twine "https://github.com/sagiadi/the-next-interview-game/blob/main/story/the-next-interview.twee"
click node_winlose "https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scenes/Win.unity"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_input,node_movement,node_sensor,node_interactor,node_puzzle,node_generator,node_npc,node_focus,node_distraction,node_launcher,node_jobboard toneBlue
class node_session,node_timer,node_rules,node_events toneAmber
class node_interview_session,node_evaluator toneMint
class node_screen,node_hud,node_panels,node_twine,node_winlose toneRose
class node_player toneIndigo
```

## Components

### City gameplay

- [Input reader](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerInputReader.cs): `Assets/Scripts/Player/PlayerInputReader.cs`
- [Player movement](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerMover.cs): `Assets/Scripts/Player/PlayerMover.cs`
- [Interaction sensor](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/InteractionSensor.cs): `Assets/Scripts/Player/InteractionSensor.cs`
- [Player interactor](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerInteractor.cs): `Assets/Scripts/Player/PlayerInteractor.cs`
- [Puzzle station](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/PuzzleStation.cs): `Assets/Scripts/World/PuzzleStation.cs`
- [Puzzle generator](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Puzzle/PuzzleGenerator.cs): `Assets/Scripts/Puzzle/PuzzleGenerator.cs`
- [Contact NPC](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/ContactNPC.cs): `Assets/Scripts/World/ContactNPC.cs`
- [Player focus](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Player/PlayerFocus.cs): `Assets/Scripts/Player/PlayerFocus.cs`
- [Distraction](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Obstacles/Distraction.cs): `Assets/Scripts/Obstacles/Distraction.cs`
- [Distraction launcher](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Obstacles/DistractionLauncher.cs): `Assets/Scripts/Obstacles/DistractionLauncher.cs`
- [Job board](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/World/JobBoardZone.cs): `Assets/Scripts/World/JobBoardZone.cs`

### Game state

- [Game session](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/GameSession.cs): `Assets/Scripts/Game/GameSession.cs`
- [Round timer](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/RoundTimer.cs): `Assets/Scripts/Game/RoundTimer.cs`
- [Round rules](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Game/RoundRules.cs): `Assets/Scripts/Game/RoundRules.cs`
- [Event channels](https://github.com/sagiadi/the-next-interview-game/tree/main/Assets/Scripts/Events): `Assets/Scripts/Events`

### Interview

- [Interview session](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Interview/InterviewSession.cs): `Assets/Scripts/Interview/InterviewSession.cs`
- [Interview evaluator](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/Interview/IInterviewEvaluator.cs): `Assets/Scripts/Interview/IInterviewEvaluator.cs`

### Presentation and story

- [Interview screen](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/UI/InterviewScreen.cs): `Assets/Scripts/UI/InterviewScreen.cs`
- [Round HUD](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scripts/UI/RoundHud.cs): `Assets/Scripts/UI/RoundHud.cs`
- [Gameplay panels](https://github.com/sagiadi/the-next-interview-game/tree/main/Assets/Scripts/UI): `Assets/Scripts/UI`
- [Twine companion story](https://github.com/sagiadi/the-next-interview-game/blob/main/story/the-next-interview.twee): `story/the-next-interview.twee`
- [Win and loss scenes](https://github.com/sagiadi/the-next-interview-game/blob/main/Assets/Scenes/Win.unity): `Assets/Scenes/Win.unity`

### Other components

- **Player**

## Connections

- Player → Input reader: provides controls (evidence: `README.md`)
- Input reader → Player movement: drives movement (evidence: `README.md`)
- Player movement → Interaction sensor: provides facing (evidence: `README.md`)
- Input reader → Player interactor: signals interaction (evidence: `README.md`)
- Player interactor → Interaction sensor: uses target (evidence: `README.md`)
- Player interactor → Puzzle station: interacts (evidence: `README.md`)
- Player interactor → Contact NPC: interacts (evidence: `README.md`)
- Player interactor → Job board: interacts (evidence: `README.md`)
- Puzzle station → Puzzle generator: requests puzzle (evidence: `README.md`)
- Puzzle station → Event channels: raises requests (evidence: `README.md`)
- Contact NPC → Game session: adds connection (evidence: `README.md`)
- Contact NPC → Event channels: raises message (evidence: `README.md`)
- Distraction → Player focus: causes focus loss (evidence: `README.md`)
- Player focus → Game session: spends time (evidence: `README.md`)
- Distraction launcher → Distraction: launches (evidence: `README.md`)
- Job board → Event channels: raises job request (evidence: `README.md`)
- Round timer → Game session: spends time (evidence: `README.md`)
- Game session → Round rules: signals time up (evidence: `README.md`)
- Round rules → Win and loss scenes: loads loss scene (evidence: `README.md`)
- Game session → Round HUD: publishes state (evidence: `README.md`)
- Event channels → Gameplay panels: notifies listeners (evidence: `README.md`)
- Interview session → Interview evaluator: scores answers (evidence: `README.md`)
- Interview session → Game session: reads job and bonus (evidence: `README.md`)
- Interview screen → Interview session: submits answers (evidence: `README.md`)
- Interview session → Interview screen: publishes interview events (evidence: `README.md`)
