# 5tefan543/uibk_cpp_project architecture

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

- Interactive diagram: https://gitdiagram.com/5tefan543/uibk_cpp_project
- Repository: https://github.com/5tefan543/uibk_cpp_project

## Overview

This is a C++ arena-survival roguelike. The main loop polls input, updates the controller’s current state, then renders its view; gameplay advances waves and stages, spawning enemies and running ECS systems, with progression-store, save/load, menus, audio, and debug capabilities around that loop. Source excerpts confirm the main loop, state transitions, and game update/render responsibilities. Other gameplay systems and UI details are represented from documented capabilities and the source index; their internal calls are not asserted where source was unsampled.

Main entry points: [`src/game/game.cpp`](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/game.cpp) (Game orchestration), [`src/controller/state/state_manager.cpp`](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/state/state_manager.cpp) (State manager), [`src/controller/persistence/persistence_manager.cpp`](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/persistence/persistence_manager.cpp) (Save and load), [`apps/main.cpp`](https://github.com/5tefan543/uibk_cpp_project/blob/main/apps/main.cpp) (Frame loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application loop"]
  node_main["Frame loop<br/>[main.cpp]"]
end

subgraph group_control["Control and states"]
  node_controller["Controller<br/>[controller.cpp]"]
  node_states["State manager<br/>[state_manager.cpp]"]
  node_state_impl["Menu and game states<br/>[state.cpp]"]
end

subgraph group_gameplay["Gameplay simulation"]
  node_game["Game orchestration<br/>[game.cpp]"]
  node_ecs["Entity registry<br/>[registry.hpp]"]
  node_location["Spatial lookup<br/>[location_table.cpp]"]
  node_input_system["Player controls<br/>[input_system.cpp]"]
  node_enemy_ai["Enemy AI"]
  node_spawn["Wave spawning"]
  node_combat["Combat systems"]
  node_movement["Movement and collision"]
  node_animation["Animation and sound"]
end

subgraph group_progression["Progression and persistence"]
  node_store["Progression store"]
  node_persistence["Save and load"]
  node_config["Game configuration<br/>[game_config.hpp]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.hpp]"]
end

subgraph group_presentation["UI and audio"]
  node_input["Input handling<br/>[input_handler.cpp]"]
  node_ui["UI and window<br/>[ui.cpp]"]
  node_renderer["View renderer<br/>[renderer.cpp]"]
  node_audio["Audio playback"]
  node_debug["Debug tools<br/>[debug_ui.cpp]"]
end

node_player(("Player"))

node_player -->|"provides input"| node_ui
node_main -->|"polls input"| node_ui
node_ui -.->|"polls through"| node_input
node_main -->|"updates"| node_controller
node_controller -.->|"updates state"| node_states
node_main -->|"gets current state"| node_states
node_states -->|"creates and transitions"| node_state_impl
node_main -->|"renders view"| node_renderer
node_ui -.->|"renders through"| node_renderer
node_state_impl -.->|"runs gameplay"| node_game
node_states -->|"opens store"| node_store
node_states -->|"plays state audio"| node_audio
node_game -->|"updates entities"| node_ecs
node_game -->|"updates spatial table"| node_location
node_game -->|"spawns wave"| node_spawn
node_game -->|"updates enemies"| node_enemy_ai
node_game -.->|"updates controls"| node_input_system
node_game -.->|"runs combat"| node_combat
node_game -.->|"runs movement"| node_movement
node_game -.->|"builds game view"| node_animation
node_game -->|"saves run"| node_persistence
node_store -->|"saves store"| node_persistence
node_persistence -.->|"loads configuration"| node_config
node_states -->|"loads game"| node_persistence
node_game -.->|"uses settings"| node_config
node_debug -.->|"controls debug session"| node_game
node_persistence -.->|"stores scores"| node_leaderboard

click node_main "https://github.com/5tefan543/uibk_cpp_project/blob/main/apps/main.cpp"
click node_controller "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/controller.cpp"
click node_states "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/state/state_manager.cpp"
click node_state_impl "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/state/state.cpp"
click node_input "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/input_handler.cpp"
click node_ui "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/ui.cpp"
click node_renderer "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/renderer.cpp"
click node_game "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/game.cpp"
click node_ecs "https://github.com/5tefan543/uibk_cpp_project/blob/main/include/game/ecs/registry.hpp"
click node_location "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/location_table.cpp"
click node_input_system "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/input_system.cpp"
click node_enemy_ai "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/enemy_ai_system.cpp"
click node_spawn "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/spawn_enemy_system.cpp"
click node_combat "https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems"
click node_movement "https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems"
click node_animation "https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems"
click node_store "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/store/progression_store.cpp"
click node_persistence "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/persistence/persistence_manager.cpp"
click node_config "https://github.com/5tefan543/uibk_cpp_project/blob/main/include/config/game_config.hpp"
click node_audio "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/audio/audio_controller.cpp"
click node_debug "https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/debug_ui.cpp"
click node_leaderboard "https://github.com/5tefan543/uibk_cpp_project/blob/main/include/controller/persistence/leaderboard.hpp"

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_main toneBlue
class node_controller,node_states,node_state_impl toneAmber
class node_game,node_ecs,node_location,node_input_system,node_enemy_ai,node_spawn,node_combat,node_movement,node_animation toneMint
class node_store,node_persistence,node_config,node_leaderboard toneRose
class node_input,node_ui,node_renderer,node_audio,node_debug,node_player toneIndigo
```

## Components

### Application loop

- [Frame loop](https://github.com/5tefan543/uibk_cpp_project/blob/main/apps/main.cpp): `apps/main.cpp`

### Control and states

- [Controller](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/controller.cpp): `src/controller/controller.cpp`
- [State manager](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/state/state_manager.cpp): `src/controller/state/state_manager.cpp`
- [Menu and game states](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/state/state.cpp): `src/controller/state/state.cpp`

### Gameplay simulation

- [Game orchestration](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/game.cpp): `src/game/game.cpp`
- [Entity registry](https://github.com/5tefan543/uibk_cpp_project/blob/main/include/game/ecs/registry.hpp): `include/game/ecs/registry.hpp`
- [Spatial lookup](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/location_table.cpp): `src/game/location_table.cpp`
- [Player controls](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/input_system.cpp): `src/game/systems/input_system.cpp`
- [Enemy AI](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/enemy_ai_system.cpp): `src/game/systems/enemy_ai_system.cpp`
- [Wave spawning](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/systems/spawn_enemy_system.cpp): `src/game/systems/spawn_enemy_system.cpp`
- [Combat systems](https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems): `include/game/ecs/systems`
- [Movement and collision](https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems): `include/game/ecs/systems`
- [Animation and sound](https://github.com/5tefan543/uibk_cpp_project/tree/main/include/game/ecs/systems): `include/game/ecs/systems`

### Progression and persistence

- [Progression store](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/game/store/progression_store.cpp): `src/game/store/progression_store.cpp`
- [Save and load](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/controller/persistence/persistence_manager.cpp): `src/controller/persistence/persistence_manager.cpp`
- [Game configuration](https://github.com/5tefan543/uibk_cpp_project/blob/main/include/config/game_config.hpp): `include/config/game_config.hpp`
- [Leaderboard](https://github.com/5tefan543/uibk_cpp_project/blob/main/include/controller/persistence/leaderboard.hpp): `include/controller/persistence/leaderboard.hpp`

### UI and audio

- [Input handling](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/input_handler.cpp): `src/ui/input_handler.cpp`
- [UI and window](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/ui.cpp): `src/ui/ui.cpp`
- [View renderer](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/renderer.cpp): `src/ui/renderer.cpp`
- [Audio playback](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/audio/audio_controller.cpp): `src/audio/audio_controller.cpp`
- [Debug tools](https://github.com/5tefan543/uibk_cpp_project/blob/main/src/ui/debug_ui.cpp): `src/ui/debug_ui.cpp`

### Other components

- **Player**

## Connections

- Player → UI and window: provides input
- Frame loop → UI and window: polls input (evidence: `apps/main.cpp`)
- UI and window → Input handling: polls through
- Frame loop → Controller: updates (evidence: `apps/main.cpp`)
- Controller → State manager: updates state
- Frame loop → State manager: gets current state (evidence: `apps/main.cpp`)
- State manager → Menu and game states: creates and transitions (evidence: `src/controller/state/state_manager.cpp`)
- Frame loop → View renderer: renders view (evidence: `apps/main.cpp`)
- UI and window → View renderer: renders through
- Menu and game states → Game orchestration: runs gameplay
- State manager → Progression store: opens store (evidence: `src/controller/state/state_manager.cpp`)
- State manager → Audio playback: plays state audio (evidence: `src/controller/state/state_manager.cpp`)
- Game orchestration → Entity registry: updates entities (evidence: `src/game/game.cpp`)
- Game orchestration → Spatial lookup: updates spatial table (evidence: `src/game/game.cpp`)
- Game orchestration → Wave spawning: spawns wave (evidence: `src/game/game.cpp`)
- Game orchestration → Enemy AI: updates enemies (evidence: `src/game/game.cpp`)
- Game orchestration → Player controls: updates controls
- Game orchestration → Combat systems: runs combat
- Game orchestration → Movement and collision: runs movement
- Game orchestration → Animation and sound: builds game view
- Game orchestration → Save and load: saves run (evidence: `src/game/game.cpp`)
- Progression store → Save and load: saves store (evidence: `src/game/store/progression_store.cpp`)
- Save and load → Game configuration: loads configuration
- State manager → Save and load: loads game
- Game orchestration → Game configuration: uses settings
- Debug tools → Game orchestration: controls debug session
- Save and load → Leaderboard: stores scores
