# awest813/league-soccer architecture

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

- Interactive diagram: https://gitdiagram.com/awest813/league-soccer
- Repository: https://github.com/awest813/league-soccer

## Overview

League-Soccer is a playable football game combining quick matches, season leagues, custom leagues, and Owner/GM, Coach, and Player careers. The main route is launch → choose a mode and teams → play a simulated match → view match results and history; management modes add persistent club and season progression. The graph includes the documented match, tactics, input, presentation, and persistence capabilities. Source excerpts are partial, so some subsystem connections reflect README documentation rather than inspected call sites.

Main entry points: [`src/onthepitch/match.cpp`](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/match.cpp) (Match Engine), [`src/menu/mainmenu.cpp`](https://github.com/awest813/league-soccer/blob/master/src/menu/mainmenu.cpp) (Main Menu), [`src/main.cpp`](https://github.com/awest813/league-soccer/blob/master/src/main.cpp) (Application Runtime), [`src/menu/league`](https://github.com/awest813/league-soccer/tree/master/src/menu/league) (League Mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_app["Application Runtime<br/>[main.cpp]"]
end

subgraph group_match["Match Simulation"]
  node_match["Match Engine<br/>[match.cpp]"]
  node_team["Teams and Players<br/>[team.cpp]"]
  node_teamai["Tactical Team AI"]
  node_playerai["Player Controllers"]
  node_ball["Ball Physics<br/>[ballphysics.cpp]"]
  node_officials["Officials<br/>[officials.cpp]"]
end

subgraph group_modes["Game Modes"]
  node_menu["Main Menu<br/>[mainmenu.cpp]"]
  node_quick["Match Setup<br/>[teamselect.cpp]"]
  node_league["League Mode"]
  node_career["Career Mode"]
  node_custom["Custom Leagues<br/>[leaguesetup.cpp]"]
end

subgraph group_presentation["Input and Presentation"]
  node_matchui["Match HUD<br/>[ingame.cpp]"]
  node_replay["Replay and History<br/>[replaymenu.cpp]"]
  node_hid["Keyboard and Gamepad"]
  node_graphics["3D Graphics"]
  node_audio["Spatial Audio<br/>[audio_system.cpp]"]
end

subgraph group_state["Game State"]
  node_data["Club and Match Data"]
  node_database[("SQLite Persistence<br/>[database.cpp]")]
end

node_player(("Player"))

node_player -->|"chooses mode"| node_menu
node_app -->|"creates menu task"| node_menu
node_app -->|"creates game task"| node_match
node_menu -->|"opens setup"| node_quick
node_menu -->|"opens mode"| node_league
node_menu -->|"opens mode"| node_career
node_menu -->|"opens setup"| node_custom
node_quick -->|"starts match"| node_match
node_league -->|"starts matchday"| node_match
node_career -->|"starts match"| node_match
node_custom -->|"defines competition"| node_league
node_match -->|"simulates teams"| node_team
node_match -->|"updates tactics"| node_teamai
node_teamai -->|"sets player roles"| node_playerai
node_match -->|"updates ball"| node_ball
node_match -->|"processes officiating"| node_officials
node_hid -->|"supplies controls"| node_playerai
node_match -->|"updates match display"| node_matchui
node_match -->|"records match history"| node_replay
node_career -->|"updates club state"| node_data
node_league -->|"updates season state"| node_data
node_match -->|"records results"| node_data
node_data -->|"reads and writes"| node_database
node_app -->|"runs system"| node_graphics
node_app -->|"runs system"| node_audio
node_matchui -.->|"reads input"| node_hid

click node_app "https://github.com/awest813/league-soccer/blob/master/src/main.cpp"
click node_menu "https://github.com/awest813/league-soccer/blob/master/src/menu/mainmenu.cpp"
click node_quick "https://github.com/awest813/league-soccer/blob/master/src/menu/startmatch/teamselect.cpp"
click node_league "https://github.com/awest813/league-soccer/tree/master/src/menu/league"
click node_career "https://github.com/awest813/league-soccer/tree/master/src/menu/career"
click node_custom "https://github.com/awest813/league-soccer/blob/master/src/league/leaguesetup.cpp"
click node_match "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/match.cpp"
click node_team "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/team.cpp"
click node_teamai "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/teamAIcontroller.cpp"
click node_playerai "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/player/controller/playercontroller.cpp"
click node_ball "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/ballphysics.cpp"
click node_officials "https://github.com/awest813/league-soccer/blob/master/src/onthepitch/officials.cpp"
click node_matchui "https://github.com/awest813/league-soccer/blob/master/src/menu/ingame/ingame.cpp"
click node_replay "https://github.com/awest813/league-soccer/blob/master/src/menu/ingame/replaymenu.cpp"
click node_hid "https://github.com/awest813/league-soccer/tree/master/src/hid"
click node_graphics "https://github.com/awest813/league-soccer/blob/master/src/systems/graphics/graphics_system.cpp"
click node_audio "https://github.com/awest813/league-soccer/blob/master/src/systems/audio/audio_system.cpp"
click node_data "https://github.com/awest813/league-soccer/tree/master/src/data"
click node_database "https://github.com/awest813/league-soccer/blob/master/src/utils/database.cpp"

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_app toneBlue
class node_match,node_team,node_teamai,node_playerai,node_ball,node_officials toneAmber
class node_menu,node_quick,node_league,node_career,node_custom toneMint
class node_matchui,node_replay,node_hid,node_graphics,node_audio toneRose
class node_data,node_database,node_player toneIndigo
```

## Components

### Game Runtime

- [Application Runtime](https://github.com/awest813/league-soccer/blob/master/src/main.cpp): `src/main.cpp`

### Match Simulation

- [Match Engine](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/match.cpp): `src/onthepitch/match.cpp`
- [Teams and Players](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/team.cpp): `src/onthepitch/team.cpp`
- [Tactical Team AI](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/teamAIcontroller.cpp): `src/onthepitch/teamAIcontroller.cpp`
- [Player Controllers](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/player/controller/playercontroller.cpp): `src/onthepitch/player/controller/playercontroller.cpp`
- [Ball Physics](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/ballphysics.cpp): `src/onthepitch/ballphysics.cpp`
- [Officials](https://github.com/awest813/league-soccer/blob/master/src/onthepitch/officials.cpp): `src/onthepitch/officials.cpp`

### Game Modes

- [Main Menu](https://github.com/awest813/league-soccer/blob/master/src/menu/mainmenu.cpp): `src/menu/mainmenu.cpp`
- [Match Setup](https://github.com/awest813/league-soccer/blob/master/src/menu/startmatch/teamselect.cpp): `src/menu/startmatch/teamselect.cpp`
- [League Mode](https://github.com/awest813/league-soccer/tree/master/src/menu/league): `src/menu/league`
- [Career Mode](https://github.com/awest813/league-soccer/tree/master/src/menu/career): `src/menu/career`
- [Custom Leagues](https://github.com/awest813/league-soccer/blob/master/src/league/leaguesetup.cpp): `src/league/leaguesetup.cpp`

### Input and Presentation

- [Match HUD](https://github.com/awest813/league-soccer/blob/master/src/menu/ingame/ingame.cpp): `src/menu/ingame/ingame.cpp`
- [Replay and History](https://github.com/awest813/league-soccer/blob/master/src/menu/ingame/replaymenu.cpp): `src/menu/ingame/replaymenu.cpp`
- [Keyboard and Gamepad](https://github.com/awest813/league-soccer/tree/master/src/hid): `src/hid`
- [3D Graphics](https://github.com/awest813/league-soccer/blob/master/src/systems/graphics/graphics_system.cpp): `src/systems/graphics/graphics_system.cpp`
- [Spatial Audio](https://github.com/awest813/league-soccer/blob/master/src/systems/audio/audio_system.cpp): `src/systems/audio/audio_system.cpp`

### Game State

- [Club and Match Data](https://github.com/awest813/league-soccer/tree/master/src/data): `src/data`
- [SQLite Persistence](https://github.com/awest813/league-soccer/blob/master/src/utils/database.cpp): `src/utils/database.cpp`

### Other components

- **Player**

## Connections

- Player → Main Menu: chooses mode
- Application Runtime → Main Menu: creates menu task
- Application Runtime → Match Engine: creates game task
- Main Menu → Match Setup: opens setup
- Main Menu → League Mode: opens mode
- Main Menu → Career Mode: opens mode
- Main Menu → Custom Leagues: opens setup
- Match Setup → Match Engine: starts match
- League Mode → Match Engine: starts matchday
- Career Mode → Match Engine: starts match
- Custom Leagues → League Mode: defines competition
- Match Engine → Teams and Players: simulates teams
- Match Engine → Tactical Team AI: updates tactics
- Tactical Team AI → Player Controllers: sets player roles
- Match Engine → Ball Physics: updates ball
- Match Engine → Officials: processes officiating
- Keyboard and Gamepad → Player Controllers: supplies controls
- Match Engine → Match HUD: updates match display
- Match Engine → Replay and History: records match history
- Career Mode → Club and Match Data: updates club state
- League Mode → Club and Match Data: updates season state
- Match Engine → Club and Match Data: records results
- Club and Match Data → SQLite Persistence: reads and writes
- Application Runtime → 3D Graphics: runs system
- Application Runtime → Spatial Audio: runs system
- Match HUD → Keyboard and Gamepad: reads input
