# sitser0/battlecity_ architecture

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

- Interactive diagram: https://gitdiagram.com/sitser0/battlecity_
- Repository: https://github.com/sitser0/battlecity_

## Overview

BattleCity is a C++/SDL game with a menu-driven flow into single-player gameplay or a level editor. Gameplay manages a level, player and opposing tanks, bullets, and map blocks; the editor lets players paint and save custom maps. The graph includes the documented two-player option, but the sampled evidence does not establish its runtime wiring. Edges are limited to README statements and relationships visible in indexed or excerpted source; unsampled implementation details are omitted.

Main entry points: [`BattleCity/Objects/Tanks/Tank.cpp`](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Tank.cpp) (Tank Logic), [`BattleCity/Objects/Object.cpp`](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Object.cpp) (Game Object), [`BattleCity/Objects/Blocks/Block.h`](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Block.h) (Block), [`BattleCity/main.cpp`](https://github.com/sitser0/battlecity_/blob/main/BattleCity/main.cpp) (Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Player Entry"]
  node_menu["Menu<br/>[main.cpp]"]
end

subgraph group_play["Game Runtime"]
  node_game["Game<br/>[Game.cpp]"]
  node_solo["Solo Game<br/>[SoloGame.h]"]
  node_levels["Level Data<br/>[levels.h]"]
  node_player_model["Player Model<br/>[Player.cpp]"]
end

subgraph group_entities["Game Objects"]
  node_object["Game Object<br/>[Object.cpp]"]
  node_tank["Tank Logic<br/>[Tank.cpp]"]
  node_t34["T34 Tank<br/>[T34.cpp]"]
  node_tiger["Tiger Tank<br/>[Tiger.cpp]"]
  node_panther["Panther Tank<br/>[Panther.cpp]"]
  node_mouse["Mouse Tank<br/>[Mouse.cpp]"]
  node_bullet["Bullet<br/>[Bullet.cpp]"]
  node_block["Block<br/>[Block.h]"]
  node_brick["Brick Wall<br/>[Brick.h]"]
  node_bushes["Bushes<br/>[Bushes.h]"]
  node_stone["Stone<br/>[Stone.h]"]
  node_constants["Game Constants<br/>[constatnti_itd.h]"]
end

subgraph group_maps["Level Creation"]
  node_editor["Level Editor<br/>[CreatingLevel.cpp]"]
end

node_player(("Player"))

node_player -->|"chooses mode"| node_menu
node_menu -->|"starts game"| node_game
node_menu -->|"opens editor"| node_editor
node_game -->|"loads level data"| node_levels
node_tank -->|"inherits"| node_object
node_bullet -->|"inherits"| node_object
node_block -->|"inherits"| node_object
node_t34 -->|"inherits"| node_tank
node_tiger -->|"inherits"| node_tank
node_panther -->|"inherits"| node_tank
node_mouse -->|"inherits"| node_tank
node_brick -->|"inherits"| node_block
node_bushes -->|"inherits"| node_block
node_stone -->|"inherits"| node_block
node_object -->|"uses definitions"| node_constants
node_editor -->|"uses definitions"| node_constants

click node_menu "https://github.com/sitser0/battlecity_/blob/main/BattleCity/main.cpp"
click node_game "https://github.com/sitser0/battlecity_/blob/main/BattleCity/GameProcess/Game.cpp"
click node_solo "https://github.com/sitser0/battlecity_/blob/main/BattleCity/GameProcess/SoloGame.h"
click node_levels "https://github.com/sitser0/battlecity_/blob/main/BattleCity/levels/levels.h"
click node_player_model "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Player.cpp"
click node_object "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Object.cpp"
click node_tank "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Tank.cpp"
click node_t34 "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/T34/T34.cpp"
click node_tiger "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Tiger/Tiger.cpp"
click node_panther "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Panther/Panther.cpp"
click node_mouse "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Mouse/Mouse.cpp"
click node_bullet "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Bullets/Bullet.cpp"
click node_block "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Block.h"
click node_brick "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/BrickWall/Brick.h"
click node_bushes "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Bushes/Bushes.h"
click node_stone "https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Stone/Stone.h"
click node_editor "https://github.com/sitser0/battlecity_/blob/main/BattleCity/CreatingLevels/CreatingLevel.cpp"
click node_constants "https://github.com/sitser0/battlecity_/blob/main/BattleCity/constatnti_itd.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_menu toneBlue
class node_game,node_solo,node_levels,node_player_model toneAmber
class node_object,node_tank,node_t34,node_tiger,node_panther,node_mouse,node_bullet,node_block,node_brick,node_bushes,node_stone,node_constants toneMint
class node_editor toneRose
class node_player toneIndigo
```

## Components

### Player Entry

- [Menu](https://github.com/sitser0/battlecity_/blob/main/BattleCity/main.cpp): `BattleCity/main.cpp`

### Game Runtime

- [Game](https://github.com/sitser0/battlecity_/blob/main/BattleCity/GameProcess/Game.cpp): `BattleCity/GameProcess/Game.cpp`
- [Solo Game](https://github.com/sitser0/battlecity_/blob/main/BattleCity/GameProcess/SoloGame.h): `BattleCity/GameProcess/SoloGame.h`
- [Level Data](https://github.com/sitser0/battlecity_/blob/main/BattleCity/levels/levels.h): `BattleCity/levels/levels.h`
- [Player Model](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Player.cpp): `BattleCity/Player.cpp`

### Game Objects

- [Game Object](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Object.cpp): `BattleCity/Objects/Object.cpp`
- [Tank Logic](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Tank.cpp): `BattleCity/Objects/Tanks/Tank.cpp`
- [T34 Tank](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/T34/T34.cpp): `BattleCity/Objects/Tanks/T34/T34.cpp`
- [Tiger Tank](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Tiger/Tiger.cpp): `BattleCity/Objects/Tanks/Tiger/Tiger.cpp`
- [Panther Tank](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Panther/Panther.cpp): `BattleCity/Objects/Tanks/Panther/Panther.cpp`
- [Mouse Tank](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Tanks/Mouse/Mouse.cpp): `BattleCity/Objects/Tanks/Mouse/Mouse.cpp`
- [Bullet](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Bullets/Bullet.cpp): `BattleCity/Objects/Bullets/Bullet.cpp`
- [Block](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Block.h): `BattleCity/Objects/Blocks/Block.h`
- [Brick Wall](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/BrickWall/Brick.h): `BattleCity/Objects/Blocks/BrickWall/Brick.h`
- [Bushes](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Bushes/Bushes.h): `BattleCity/Objects/Blocks/Bushes/Bushes.h`
- [Stone](https://github.com/sitser0/battlecity_/blob/main/BattleCity/Objects/Blocks/Stone/Stone.h): `BattleCity/Objects/Blocks/Stone/Stone.h`
- [Game Constants](https://github.com/sitser0/battlecity_/blob/main/BattleCity/constatnti_itd.h): `BattleCity/constatnti_itd.h`

### Level Creation

- [Level Editor](https://github.com/sitser0/battlecity_/blob/main/BattleCity/CreatingLevels/CreatingLevel.cpp): `BattleCity/CreatingLevels/CreatingLevel.cpp`

### Other components

- **Player**

## Connections

- Player → Menu: chooses mode (evidence: `README.MD`)
- Menu → Game: starts game (evidence: `BattleCity/main.cpp`)
- Menu → Level Editor: opens editor (evidence: `BattleCity/main.cpp`)
- Game → Level Data: loads level data (evidence: `BattleCity/GameProcess/Game.cpp`)
- Tank Logic → Game Object: inherits
- Bullet → Game Object: inherits
- Block → Game Object: inherits (evidence: `BattleCity/Objects/Blocks/Block.h`)
- T34 Tank → Tank Logic: inherits
- Tiger Tank → Tank Logic: inherits
- Panther Tank → Tank Logic: inherits
- Mouse Tank → Tank Logic: inherits
- Brick Wall → Block: inherits (evidence: `BattleCity/Objects/Blocks/BrickWall/Brick.h`)
- Bushes → Block: inherits (evidence: `BattleCity/Objects/Blocks/Bushes/Bushes.h`)
- Stone → Block: inherits (evidence: `BattleCity/Objects/Blocks/Stone/Stone.h`)
- Game Object → Game Constants: uses definitions
- Level Editor → Game Constants: uses definitions
