# jinjooyoung/2026_gamealgorithm_final architecture

> Architecture diagram of the GitHub repository jinjooyoung/2026_gamealgorithm_final, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jinjooyoung/2026_gamealgorithm_final
- Repository: https://github.com/jinjooyoung/2026_gamealgorithm_final

## Overview

This Unity project is a BFS-based maze tower-defense game. The likely player-to-result loop is building or solving a maze, then defending it against monster waves with towers; the tree also shows placement, combat, phase, and HUD subsystems. The README confirms only the game concept and BFS use, not runtime call relationships. Accordingly, the graph identifies the principal domain components but omits speculative connections; unsampled directories are used where the tree shows a subsystem but not its internal wiring.

Main entry points: [`Assets/Scripts/Core/Grid/GridData.cs`](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Grid/GridData.cs) (Grid model), [`Assets/Scripts/Core/Tetromino/PiecePlacement.cs`](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tetromino/PiecePlacement.cs) (Piece placement), [`Assets/Scripts/Core/Monster/MonsterMover.cs`](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/MonsterMover.cs) (Monster movement), [`Assets/Scripts/Core/Stage/StageGenerator.cs`](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Stage/StageGenerator.cs) (Stage generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game flow"]
  node_phase["Phase state<br/>[PhaseMachine.cs]"]
  node_playerstate["Player state<br/>[PlayerState.cs]"]
  node_gamemanager["Game manager<br/>[GameManager.cs]"]
end

subgraph group_maze["Maze and placement"]
  node_stage["Stage generation<br/>[StageGenerator.cs]"]
  node_grid["Grid model<br/>[GridData.cs]"]
  node_mazeinput["Maze controls<br/>[MazeMouseInput.cs]"]
  node_mazebuilder["Maze builder<br/>[MazeBuilder.cs]"]
  node_placement["Piece placement<br/>[PiecePlacement.cs]"]
  node_validator["Placement rules"]
  node_solver["Maze solver<br/>[MazeSolver.cs]"]
  node_flowfield["BFS flow field"]
end

subgraph group_defense["Defense simulation"]
  node_towerplacement["Tower placement<br/>[TowerBuilder.cs]"]
  node_towerdata["Tower registry<br/>[TowerRegistry.cs]"]
  node_waves["Wave spawning<br/>[WaveSpawner.cs]"]
  node_monsters["Monster movement<br/>[MonsterMover.cs]"]
  node_occupancy["Monster occupancy"]
  node_combat["Tower attacks"]
  node_targeting["Target selection<br/>[TargetSelector.cs]"]
end

subgraph group_interface["Player interface"]
  node_hud["Game HUD<br/>[DebugHud.cs]"]
  node_phaseui["Phase controls"]
  node_results["Result popup<br/>[ResultPopup.cs]"]
  node_gridview["Grid display<br/>[GridView.cs]"]
end

node_player(("Player"))

node_player -.->|"controls maze"| node_mazeinput
node_player -.->|"places towers"| node_towerplacement
node_stage -.->|"initializes"| node_grid
node_mazebuilder -.->|"places pieces"| node_placement
node_placement -.->|"checks placement"| node_validator
node_solver -.->|"solves maze"| node_grid
node_flowfield -.->|"uses BFS"| node_grid
node_waves -.->|"spawns"| node_monsters
node_monsters -.->|"updates occupancy"| node_occupancy
node_combat -.->|"selects targets"| node_targeting
node_player -.->|"uses controls"| node_phaseui
node_hud -.->|"shows status"| node_player
node_gridview -.->|"shows grid"| node_player
node_results -.->|"shows outcome"| node_player

click node_phase "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Game/PhaseMachine.cs"
click node_playerstate "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Game/PlayerState.cs"
click node_gamemanager "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/GameManager.cs"
click node_stage "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Stage/StageGenerator.cs"
click node_grid "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Grid/GridData.cs"
click node_mazeinput "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/MazeMouseInput.cs"
click node_mazebuilder "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/MazeBuilder.cs"
click node_placement "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tetromino/PiecePlacement.cs"
click node_validator "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tetromino/PlacementValidator.cs"
click node_solver "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Solver/MazeSolver.cs"
click node_flowfield "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Pathfinding/BfsFlowFieldSolver.cs"
click node_towerplacement "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/TowerBuilder.cs"
click node_towerdata "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tower/TowerRegistry.cs"
click node_waves "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/WaveSpawner.cs"
click node_monsters "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/MonsterMover.cs"
click node_occupancy "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/MonsterOccupancy.cs"
click node_combat "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/TowerAttackSystem.cs"
click node_targeting "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Combat/TargetSelector.cs"
click node_hud "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/DebugHud.cs"
click node_phaseui "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/PhaseUIController.cs"
click node_results "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/ResultPopup.cs"
click node_gridview "https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Grid/GridView.cs"

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_phase,node_playerstate,node_gamemanager toneBlue
class node_stage,node_grid,node_mazeinput,node_mazebuilder,node_placement,node_validator,node_solver,node_flowfield toneAmber
class node_towerplacement,node_towerdata,node_waves,node_monsters,node_occupancy,node_combat,node_targeting toneMint
class node_hud,node_phaseui,node_results,node_gridview toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Phase state](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Game/PhaseMachine.cs): `Assets/Scripts/Core/Game/PhaseMachine.cs`
- [Player state](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Game/PlayerState.cs): `Assets/Scripts/Core/Game/PlayerState.cs`
- [Game manager](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/GameManager.cs): `Assets/Scripts/Manager/GameManager.cs`

### Maze and placement

- [Stage generation](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Stage/StageGenerator.cs): `Assets/Scripts/Core/Stage/StageGenerator.cs`
- [Grid model](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Grid/GridData.cs): `Assets/Scripts/Core/Grid/GridData.cs`
- [Maze controls](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/MazeMouseInput.cs): `Assets/Scripts/Manager/MazeMouseInput.cs`
- [Maze builder](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/MazeBuilder.cs): `Assets/Scripts/Manager/MazeBuilder.cs`
- [Piece placement](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tetromino/PiecePlacement.cs): `Assets/Scripts/Core/Tetromino/PiecePlacement.cs`
- [Placement rules](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tetromino/PlacementValidator.cs): `Assets/Scripts/Core/Tetromino/PlacementValidator.cs`
- [Maze solver](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Solver/MazeSolver.cs): `Assets/Scripts/Core/Solver/MazeSolver.cs`
- [BFS flow field](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Pathfinding/BfsFlowFieldSolver.cs): `Assets/Scripts/Core/Pathfinding/BfsFlowFieldSolver.cs`

### Defense simulation

- [Tower placement](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/TowerBuilder.cs): `Assets/Scripts/Manager/TowerBuilder.cs`
- [Tower registry](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Tower/TowerRegistry.cs): `Assets/Scripts/Core/Tower/TowerRegistry.cs`
- [Wave spawning](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/WaveSpawner.cs): `Assets/Scripts/Core/Monster/WaveSpawner.cs`
- [Monster movement](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/MonsterMover.cs): `Assets/Scripts/Core/Monster/MonsterMover.cs`
- [Monster occupancy](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Monster/MonsterOccupancy.cs): `Assets/Scripts/Core/Monster/MonsterOccupancy.cs`
- [Tower attacks](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Manager/TowerAttackSystem.cs): `Assets/Scripts/Manager/TowerAttackSystem.cs`
- [Target selection](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Core/Combat/TargetSelector.cs): `Assets/Scripts/Core/Combat/TargetSelector.cs`

### Player interface

- [Game HUD](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/DebugHud.cs): `Assets/Scripts/UI/DebugHud.cs`
- [Phase controls](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/PhaseUIController.cs): `Assets/Scripts/UI/PhaseUIController.cs`
- [Result popup](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/UI/ResultPopup.cs): `Assets/Scripts/UI/ResultPopup.cs`
- [Grid display](https://github.com/jinjooyoung/2026_gamealgorithm_final/blob/main/Assets/Scripts/Grid/GridView.cs): `Assets/Scripts/Grid/GridView.cs`

### Other components

- **Player**

## Connections

- Player → Maze controls: controls maze
- Player → Tower placement: places towers
- Stage generation → Grid model: initializes
- Maze builder → Piece placement: places pieces
- Piece placement → Placement rules: checks placement
- Maze solver → Grid model: solves maze
- BFS flow field → Grid model: uses BFS (evidence: `README.md`)
- Wave spawning → Monster movement: spawns
- Monster movement → Monster occupancy: updates occupancy
- Tower attacks → Target selection: selects targets
- Player → Phase controls: uses controls
- Game HUD → Player: shows status
- Grid display → Player: shows grid
- Result popup → Player: shows outcome
