# ilya0107/student-simulator architecture

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

- Interactive diagram: https://gitdiagram.com/ilya0107/student-simulator
- Repository: https://github.com/ilya0107/student-simulator

## Overview

student-simulator is a Windows console game: the player selects a character and starting bonus, then makes choices across ten days while managing health, knowledge, and money. Daily costs and probabilistic dreams modify those resources; the game can end early on resource failure or proceed to an exam with grade, bribery, and special-ending branches. The sampled source shows the game loop, player rules, content tables, and console-color wrapper. Other documented ending variants are represented by the exam subsystem; their exact wiring is not expanded beyond the inspected code.

Main entry points: [`src/main.cpp`](https://github.com/ilya0107/student-simulator/blob/main/src/main.cpp) (Game loop), [`src/player.cpp`](https://github.com/ilya0107/student-simulator/blob/main/src/player.cpp) (Player), [`src/color.cpp`](https://github.com/ilya0107/student-simulator/blob/main/src/color.cpp) (Console colors), [`src/text_data.cpp`](https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp) (Ending text)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Daily gameplay"]
  node_game["Game loop<br/>[main.cpp]"]
  node_daily["Daily choices<br/>[text_data.cpp]"]
  node_dreams["Dream content<br/>[text_data.cpp]"]
end

subgraph group_rules["Game rules"]
  node_player["Player<br/>[player.cpp]"]
  node_exam["Exam outcomes<br/>[player.cpp]"]
  node_endingdata["Ending text<br/>[text_data.cpp]"]
  node_playerdata["Player definitions<br/>[player.h]"]
end

subgraph group_presentation["Console presentation"]
  node_colors["Console colors<br/>[color.cpp]"]
end

node_terminal(("Player"))
node_windows["Windows console"]

node_terminal -->|"chooses and enters"| node_game
node_game -->|"reads day data"| node_daily
node_game -->|"applies effects"| node_player
node_game -->|"checks early end"| node_player
node_game -->|"reads dream data"| node_dreams
node_game -->|"applies dream effect"| node_player
node_game -->|"calls after ten days"| node_exam
node_exam -->|"reads ending text"| node_endingdata
node_player -->|"reads failure text"| node_endingdata
node_game -->|"sets display color"| node_colors
node_player -->|"sets display color"| node_colors
node_colors -->|"sets console attributes"| node_windows

click node_player "https://github.com/ilya0107/student-simulator/blob/main/src/player.cpp"
click node_game "https://github.com/ilya0107/student-simulator/blob/main/src/main.cpp"
click node_daily "https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp"
click node_dreams "https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp"
click node_exam "https://github.com/ilya0107/student-simulator/blob/main/src/player.cpp"
click node_endingdata "https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp"
click node_colors "https://github.com/ilya0107/student-simulator/blob/main/src/color.cpp"
click node_playerdata "https://github.com/ilya0107/student-simulator/blob/main/src/player.h"

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_game,node_daily,node_dreams toneBlue
class node_player,node_exam,node_endingdata,node_playerdata toneAmber
class node_colors toneMint
class node_terminal,node_windows toneIndigo
```

## Components

### Daily gameplay

- [Game loop](https://github.com/ilya0107/student-simulator/blob/main/src/main.cpp): `src/main.cpp`
- [Daily choices](https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp): `src/text_data.cpp`
- [Dream content](https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp): `src/text_data.cpp`

### Game rules

- [Player](https://github.com/ilya0107/student-simulator/blob/main/src/player.cpp): `src/player.cpp`
- [Exam outcomes](https://github.com/ilya0107/student-simulator/blob/main/src/player.cpp): `src/player.cpp`
- [Ending text](https://github.com/ilya0107/student-simulator/blob/main/src/text_data.cpp): `src/text_data.cpp`
- [Player definitions](https://github.com/ilya0107/student-simulator/blob/main/src/player.h): `src/player.h`

### Console presentation

- [Console colors](https://github.com/ilya0107/student-simulator/blob/main/src/color.cpp): `src/color.cpp`

### Other components

- **Player**
- **Windows console**

## Connections

- Player → Game loop: chooses and enters
- Game loop → Daily choices: reads day data
- Game loop → Player: applies effects
- Game loop → Player: checks early end
- Game loop → Dream content: reads dream data
- Game loop → Player: applies dream effect
- Game loop → Exam outcomes: calls after ten days
- Exam outcomes → Ending text: reads ending text
- Player → Ending text: reads failure text
- Game loop → Console colors: sets display color
- Player → Console colors: sets display color
- Console colors → Windows console: sets console attributes
