# kjkit/kolejarz architecture

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

- Interactive diagram: https://gitdiagram.com/kjkit/kolejarz
- Repository: https://github.com/kjkit/kolejarz

## Overview

Kolejarz is a desktop railway-station simulation game: the player runs the simulation and manages trains using station, timetable, track, and locomotive controls. The README only describes downloading and unpacking the game, so it does not document the detailed gameplay sequence. The graph reflects the sampled UI calls and source-index references; links involving unsampled orchestration or simulation internals are omitted or marked unverified.

Main entry points: [`Stacja.cpp`](https://github.com/kjkit/kolejarz/blob/main/Stacja.cpp) (Station simulation), [`FKolejarz.cpp`](https://github.com/kjkit/kolejarz/blob/main/FKolejarz.cpp) (Main game window), [`Poczatek.cpp`](https://github.com/kjkit/kolejarz/blob/main/Poczatek.cpp) (Startup screen), [`OBocznica.cpp`](https://github.com/kjkit/kolejarz/blob/main/OBocznica.cpp) (Siding view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game interface"]
  node_main["Main game window<br/>[FKolejarz.cpp]"]
  node_startup["Startup screen<br/>[Poczatek.cpp]"]
  node_timetable_view["Timetable view<br/>[ORozklad.cpp]"]
  node_siding_view["Siding view<br/>[OBocznica.cpp]"]
  node_passing_view["Passing-loop view<br/>[OMijanka.cpp]"]
  node_depot_view["Locomotive depot view<br/>[OLokom.cpp]"]
  node_settings["Game options<br/>[Opcje.cpp]"]
  node_arrivals_departures["Arrival and departure view<br/>[WjazdWyjazd.cpp]"]
end

subgraph group_simulation["Railway simulation"]
  node_station["Station simulation<br/>[Stacja.cpp]"]
  node_schedule["Timetable model<br/>[Rozklad.cpp]"]
  node_moving_object["Moving trains<br/>[Obiekt.cpp]"]
  node_locomotives["Locomotive management<br/>[Lokom.cpp]"]
  node_clock["Simulation clock<br/>[Inne.cpp]"]
  node_track_selection["Track selection<br/>[Stacja.h]"]
end

subgraph group_support["Game support"]
  node_about["About dialog<br/>[OProgramie.cpp]"]
  node_notices["Notices<br/>[Uwagi.cpp]"]
  node_help["Help materials"]
  node_game_package["Downloadable game<br/>[Kolejarz.zip]"]
end

node_player(("Player"))

node_player -->|"downloads"| node_game_package
node_player -.->|"plays"| node_main
node_startup -->|"opens"| node_main
node_startup -->|"references"| node_notices
node_timetable_view -->|"reads train state"| node_station
node_siding_view -->|"reads siding state"| node_station
node_siding_view -->|"selects route"| node_track_selection
node_passing_view -->|"reads passing-loop state"| node_station
node_depot_view -->|"requests depot data"| node_station
node_main -.->|"drives simulation"| node_station
node_station -.->|"uses timetable"| node_schedule
node_station -.->|"moves trains"| node_moving_object
node_station -.->|"manages locomotives"| node_locomotives
node_station -.->|"advances time"| node_clock
node_main -.->|"opens options"| node_settings
node_main -.->|"opens view"| node_arrivals_departures
node_main -.->|"opens dialog"| node_about

click node_main "https://github.com/kjkit/kolejarz/blob/main/FKolejarz.cpp"
click node_startup "https://github.com/kjkit/kolejarz/blob/main/Poczatek.cpp"
click node_timetable_view "https://github.com/kjkit/kolejarz/blob/main/ORozklad.cpp"
click node_siding_view "https://github.com/kjkit/kolejarz/blob/main/OBocznica.cpp"
click node_passing_view "https://github.com/kjkit/kolejarz/blob/main/OMijanka.cpp"
click node_depot_view "https://github.com/kjkit/kolejarz/blob/main/OLokom.cpp"
click node_station "https://github.com/kjkit/kolejarz/blob/main/Stacja.cpp"
click node_schedule "https://github.com/kjkit/kolejarz/blob/main/Rozklad.cpp"
click node_moving_object "https://github.com/kjkit/kolejarz/blob/main/Obiekt.cpp"
click node_locomotives "https://github.com/kjkit/kolejarz/blob/main/Lokom.cpp"
click node_clock "https://github.com/kjkit/kolejarz/blob/main/Inne.cpp"
click node_track_selection "https://github.com/kjkit/kolejarz/blob/main/Stacja.h"
click node_settings "https://github.com/kjkit/kolejarz/blob/main/Opcje.cpp"
click node_arrivals_departures "https://github.com/kjkit/kolejarz/blob/main/WjazdWyjazd.cpp"
click node_about "https://github.com/kjkit/kolejarz/blob/main/OProgramie.cpp"
click node_notices "https://github.com/kjkit/kolejarz/blob/main/Uwagi.cpp"
click node_help "https://github.com/kjkit/kolejarz/tree/main/help"
click node_game_package "https://github.com/kjkit/kolejarz/blob/main/Kolejarz.zip"

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,node_startup,node_timetable_view,node_siding_view,node_passing_view,node_depot_view,node_settings,node_arrivals_departures toneBlue
class node_station,node_schedule,node_moving_object,node_locomotives,node_clock,node_track_selection toneAmber
class node_about,node_notices,node_help,node_game_package toneMint
class node_player toneIndigo
```

## Components

### Game interface

- [Main game window](https://github.com/kjkit/kolejarz/blob/main/FKolejarz.cpp): `FKolejarz.cpp`
- [Startup screen](https://github.com/kjkit/kolejarz/blob/main/Poczatek.cpp): `Poczatek.cpp`
- [Timetable view](https://github.com/kjkit/kolejarz/blob/main/ORozklad.cpp): `ORozklad.cpp`
- [Siding view](https://github.com/kjkit/kolejarz/blob/main/OBocznica.cpp): `OBocznica.cpp`
- [Passing-loop view](https://github.com/kjkit/kolejarz/blob/main/OMijanka.cpp): `OMijanka.cpp`
- [Locomotive depot view](https://github.com/kjkit/kolejarz/blob/main/OLokom.cpp): `OLokom.cpp`
- [Game options](https://github.com/kjkit/kolejarz/blob/main/Opcje.cpp): `Opcje.cpp`
- [Arrival and departure view](https://github.com/kjkit/kolejarz/blob/main/WjazdWyjazd.cpp): `WjazdWyjazd.cpp`

### Railway simulation

- [Station simulation](https://github.com/kjkit/kolejarz/blob/main/Stacja.cpp): `Stacja.cpp`
- [Timetable model](https://github.com/kjkit/kolejarz/blob/main/Rozklad.cpp): `Rozklad.cpp`
- [Moving trains](https://github.com/kjkit/kolejarz/blob/main/Obiekt.cpp): `Obiekt.cpp`
- [Locomotive management](https://github.com/kjkit/kolejarz/blob/main/Lokom.cpp): `Lokom.cpp`
- [Simulation clock](https://github.com/kjkit/kolejarz/blob/main/Inne.cpp): `Inne.cpp`
- [Track selection](https://github.com/kjkit/kolejarz/blob/main/Stacja.h): `Stacja.h`

### Game support

- [About dialog](https://github.com/kjkit/kolejarz/blob/main/OProgramie.cpp): `OProgramie.cpp`
- [Notices](https://github.com/kjkit/kolejarz/blob/main/Uwagi.cpp): `Uwagi.cpp`
- [Help materials](https://github.com/kjkit/kolejarz/tree/main/help): `help`
- [Downloadable game](https://github.com/kjkit/kolejarz/blob/main/Kolejarz.zip): `Kolejarz.zip`

### Other components

- **Player**

## Connections

- Player → Downloadable game: downloads (evidence: `README.md`)
- Player → Main game window: plays
- Startup screen → Main game window: opens (evidence: `Poczatek.cpp`)
- Startup screen → Notices: references (evidence: `Poczatek.cpp`)
- Timetable view → Station simulation: reads train state (evidence: `ORozklad.cpp`)
- Siding view → Station simulation: reads siding state (evidence: `OBocznica.cpp`)
- Siding view → Track selection: selects route (evidence: `OBocznica.cpp`)
- Passing-loop view → Station simulation: reads passing-loop state (evidence: `OMijanka.cpp`)
- Locomotive depot view → Station simulation: requests depot data (evidence: `OLokom.cpp`)
- Main game window → Station simulation: drives simulation
- Station simulation → Timetable model: uses timetable
- Station simulation → Moving trains: moves trains
- Station simulation → Locomotive management: manages locomotives
- Station simulation → Simulation clock: advances time
- Main game window → Game options: opens options
- Main game window → Arrival and departure view: opens view
- Main game window → About dialog: opens dialog
