# mariem-chaouch/scotland_yard architecture

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

- Interactive diagram: https://gitdiagram.com/mariem-chaouch/scotland_yard
- Repository: https://github.com/mariem-chaouch/scotland_yard

## Overview

PLT appears to be a Scotland Yard–style board game: the tree names Mr X, detectives, stations, moves, and game rules, while the client has separate rendering layers. The sampled material does not show enough client-to-engine or server behavior to establish those runtime links. The repository also bundles dia2code, a Dia-diagram-to-code generator, and JsonCpp; these are represented as distinct subsystems. Connections are limited to relationships visible in the supplied source index or excerpts.

Main entry points: [`extern/dia2code/src/main.c`](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/main.c) (Generator CLI), [`extern/dia2code/src/generate_code_cpp.c`](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/generate_code_cpp.c) (C++ generator), [`extern/dia2code/src/source_parser.c`](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/source_parser.c) (Source preservation), [`extern/jsoncpp-1.8.0/jsoncpp.cpp`](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/jsoncpp-1.8.0/jsoncpp.cpp) (JsonCpp)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game domain"]
  node_player["Player<br/>[Player.cpp]"]
  node_detective["Detective<br/>[Detective.cpp]"]
  node_mrx["Mr X<br/>[MrX.cpp]"]
  node_gamestate["Game state<br/>[GameState.cpp]"]
  node_board["Board and stations<br/>[Board.cpp]"]
  node_engine["Game engine<br/>[Engine.cpp]"]
  node_rules["Rules<br/>[Rules.cpp]"]
  node_movecommands["Move commands<br/>[MoveCommand.cpp]"]
  node_doublemove["Double move"]
  node_passcommand["Pass command<br/>[PassCommand.cpp]"]
  node_startcommand["Start command<br/>[StartCommand.cpp]"]
  node_randomai["Random AI<br/>[RandomAI.cpp]"]
end

subgraph group_client["Game client"]
  node_cliententry["Client entry<br/>[main.cpp]"]
  node_scene["Game scene<br/>[Scene.cpp]"]
  node_boardview["Board view<br/>[BoardLayer.cpp]"]
  node_infoview["Game info<br/>[InfoLayer.cpp]"]
  node_playersview["Players view<br/>[PlayersLayer.cpp]"]
  node_menulayer["Main menu<br/>[MainMenuLayer.cpp]"]
  node_renderlayer["Render layer<br/>[Layer.cpp]"]
end

subgraph group_dia2code["Dia2code generator"]
  node_diaentry["Generator CLI<br/>[main.c]"]
  node_diagramparser["Diagram parser<br/>[parse_diagram.c]"]
  node_generatorcore["Generator core<br/>[dia2code.c]"]
  node_cppgenerator["C++ generator"]
  node_declarations["Declarations<br/>[decls.c]"]
  node_includes["Include analysis<br/>[includes.c]"]
  node_sourcepreserve["Source preservation<br/>[source_parser.c]"]
end

subgraph group_vendor["Vendored library"]
  node_jsoncpp["JsonCpp<br/>[jsoncpp.cpp]"]
  node_jsonheader["JsonCpp API<br/>[json.h]"]
end

node_diauser(("Generator user"))

node_diauser -.->|"invokes"| node_diaentry
node_diaentry -->|"parses diagram"| node_diagramparser
node_diaentry -->|"dispatches generator"| node_cppgenerator
node_cppgenerator -->|"uses declarations"| node_declarations
node_cppgenerator -->|"uses include analysis"| node_includes
node_sourcepreserve -->|"uses shared types"| node_generatorcore
node_jsoncpp -->|"implements API"| node_jsonheader

click node_player "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Player.cpp"
click node_detective "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Detective.cpp"
click node_mrx "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/MrX.cpp"
click node_gamestate "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/GameState.cpp"
click node_board "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Board.cpp"
click node_engine "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/Engine.cpp"
click node_rules "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/Rules.cpp"
click node_movecommands "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/MoveCommand.cpp"
click node_doublemove "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/DoubleMoveCommand.cpp"
click node_passcommand "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/PassCommand.cpp"
click node_startcommand "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/StartCommand.cpp"
click node_randomai "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/ai/RandomAI.cpp"
click node_cliententry "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/main.cpp"
click node_scene "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/Scene.cpp"
click node_boardview "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/BoardLayer.cpp"
click node_infoview "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/InfoLayer.cpp"
click node_playersview "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/PlayersLayer.cpp"
click node_menulayer "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/MainMenuLayer.cpp"
click node_renderlayer "https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/Layer.cpp"
click node_diaentry "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/main.c"
click node_diagramparser "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/parse_diagram.c"
click node_generatorcore "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/dia2code.c"
click node_cppgenerator "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/generate_code_cpp.c"
click node_declarations "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/decls.c"
click node_includes "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/includes.c"
click node_sourcepreserve "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/source_parser.c"
click node_jsoncpp "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/jsoncpp-1.8.0/jsoncpp.cpp"
click node_jsonheader "https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/jsoncpp-1.8.0/json/json.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_player,node_detective,node_mrx,node_gamestate,node_board,node_engine,node_rules,node_movecommands,node_doublemove,node_passcommand,node_startcommand,node_randomai,node_diauser toneBlue
class node_cliententry,node_scene,node_boardview,node_infoview,node_playersview,node_menulayer,node_renderlayer toneAmber
class node_diaentry,node_diagramparser,node_generatorcore,node_cppgenerator,node_declarations,node_includes,node_sourcepreserve toneMint
class node_jsoncpp,node_jsonheader toneRose
```

## Components

### Game domain

- [Player](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Player.cpp): `src/shared/state/Player.cpp`
- [Detective](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Detective.cpp): `src/shared/state/Detective.cpp`
- [Mr X](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/MrX.cpp): `src/shared/state/MrX.cpp`
- [Game state](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/GameState.cpp): `src/shared/state/GameState.cpp`
- [Board and stations](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/state/Board.cpp): `src/shared/state/Board.cpp`
- [Game engine](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/Engine.cpp): `src/shared/engine/Engine.cpp`
- [Rules](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/Rules.cpp): `src/shared/engine/Rules.cpp`
- [Move commands](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/MoveCommand.cpp): `src/shared/engine/MoveCommand.cpp`
- [Double move](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/DoubleMoveCommand.cpp): `src/shared/engine/DoubleMoveCommand.cpp`
- [Pass command](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/PassCommand.cpp): `src/shared/engine/PassCommand.cpp`
- [Start command](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/engine/StartCommand.cpp): `src/shared/engine/StartCommand.cpp`
- [Random AI](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/shared/ai/RandomAI.cpp): `src/shared/ai/RandomAI.cpp`

### Game client

- [Client entry](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/main.cpp): `src/client/main.cpp`
- [Game scene](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/Scene.cpp): `src/client/render/Scene.cpp`
- [Board view](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/BoardLayer.cpp): `src/client/render/BoardLayer.cpp`
- [Game info](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/InfoLayer.cpp): `src/client/render/InfoLayer.cpp`
- [Players view](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/PlayersLayer.cpp): `src/client/render/PlayersLayer.cpp`
- [Main menu](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/MainMenuLayer.cpp): `src/client/render/MainMenuLayer.cpp`
- [Render layer](https://github.com/mariem-chaouch/scotland_yard/blob/master/src/client/render/Layer.cpp): `src/client/render/Layer.cpp`

### Dia2code generator

- [Generator CLI](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/main.c): `extern/dia2code/src/main.c`
- [Diagram parser](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/parse_diagram.c): `extern/dia2code/src/parse_diagram.c`
- [Generator core](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/dia2code.c): `extern/dia2code/src/dia2code.c`
- [C++ generator](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/generate_code_cpp.c): `extern/dia2code/src/generate_code_cpp.c`
- [Declarations](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/decls.c): `extern/dia2code/src/decls.c`
- [Include analysis](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/includes.c): `extern/dia2code/src/includes.c`
- [Source preservation](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/dia2code/src/source_parser.c): `extern/dia2code/src/source_parser.c`

### Vendored library

- [JsonCpp](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/jsoncpp-1.8.0/jsoncpp.cpp): `extern/jsoncpp-1.8.0/jsoncpp.cpp`
- [JsonCpp API](https://github.com/mariem-chaouch/scotland_yard/blob/master/extern/jsoncpp-1.8.0/json/json.h): `extern/jsoncpp-1.8.0/json/json.h`

### Other components

- **Generator user**

## Connections

- Generator user → Generator CLI: invokes
- Generator CLI → Diagram parser: parses diagram (evidence: `extern/dia2code/src/main.c`)
- Generator CLI → C++ generator: dispatches generator (evidence: `extern/dia2code/src/main.c`)
- C++ generator → Declarations: uses declarations (evidence: `extern/dia2code/src/generate_code_cpp.c`)
- C++ generator → Include analysis: uses include analysis (evidence: `extern/dia2code/src/generate_code_cpp.c`)
- Source preservation → Generator core: uses shared types (evidence: `extern/dia2code/src/source_parser.c`)
- JsonCpp → JsonCpp API: implements API (evidence: `extern/jsoncpp-1.8.0/jsoncpp.cpp`)
