# yoshibar-003/code-and-conquer architecture

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

- Interactive diagram: https://gitdiagram.com/yoshibar-003/code-and-conquer
- Repository: https://github.com/yoshibar-003/code-and-conquer

## Overview

Code & Conquer is a Godot programming game: players write C++ or Python robot programs, run or step through them, and see the robot act in a level. The README documents editor, sandboxing, synchronized debugging, level import, camera rotation, and JSON level loading. The tree and excerpts do not expose most Godot script filenames or their calls, so directory paths and README-supported relationships are used for those areas; only the worker’s command handling is sampled.

Main entry points: [`workstation/scripts`](https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts) (Code workstation), [`map/scripts`](https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts) (Isometric simulation), [`sandbox_worker/src/main.cpp`](https://github.com/yoshibar-003/code-and-conquer/blob/main/sandbox_worker/src/main.cpp) (Sandbox worker), [`execution`](https://github.com/yoshibar-003/code-and-conquer/tree/main/execution) (Execution dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workbench["Workstation"]
  node_workstation["Code workstation"]
  node_editor["Code editor"]
  node_debug["Step debugger"]
  node_level_editor["Level editor"]
end

subgraph group_runtime["Code Runtime"]
  node_execution["Execution dispatch"]
  node_cpp_execution["C++ execution"]
  node_python_execution["Python execution"]
  node_shared_execution["Shared execution"]
  node_worker["Sandbox worker<br/>[main.cpp]"]
end

subgraph group_world["Game World"]
  node_game_world["Isometric simulation"]
  node_robot["Robot actions and sensors"]
  node_camera["Rotatable camera"]
end

subgraph group_content["Levels &amp; Assets"]
  node_level_loader["JSON level loading"]
  node_campaign["Campaign solutions"]
  node_main_menu["Main menu"]
  node_assets["Game assets"]
end

node_player(("Player"))
node_gcc["GCC compiler"]
node_python["Python runtime"]

node_player -->|"writes code"| node_workstation
node_workstation -->|"hosts editor"| node_editor
node_player -->|"runs or steps"| node_workstation
node_workstation -->|"dispatches code"| node_execution
node_execution -.->|"routes C++"| node_cpp_execution
node_execution -.->|"routes Python"| node_python_execution
node_cpp_execution -.->|"uses sandbox"| node_worker
node_python_execution -.->|"uses sandbox"| node_worker
node_cpp_execution -.->|"uses shared logic"| node_shared_execution
node_python_execution -.->|"uses shared logic"| node_shared_execution
node_worker -.->|"runs compiled code"| node_gcc
node_worker -.->|"runs student code"| node_python
node_workstation -->|"synchronizes stepping"| node_debug
node_debug -->|"shows execution"| node_game_world
node_game_world -.->|"simulates actions"| node_robot
node_player -.->|"edits levels"| node_level_editor
node_level_editor -->|"imports JSON"| node_level_loader
node_level_loader -->|"loads level"| node_game_world
node_player -->|"rotates view"| node_camera
node_campaign -->|"uses robot commands"| node_robot
node_main_menu -.->|"enters game"| node_game_world
node_game_world -.->|"uses visuals"| node_assets

click node_workstation "https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts"
click node_editor "https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts"
click node_debug "https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts"
click node_level_editor "https://github.com/yoshibar-003/code-and-conquer/tree/main/level_editor/scripts"
click node_execution "https://github.com/yoshibar-003/code-and-conquer/tree/main/execution"
click node_cpp_execution "https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/cpp"
click node_python_execution "https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/python"
click node_shared_execution "https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/shared"
click node_worker "https://github.com/yoshibar-003/code-and-conquer/blob/main/sandbox_worker/src/main.cpp"
click node_game_world "https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts"
click node_robot "https://github.com/yoshibar-003/code-and-conquer/tree/main/player/scripts"
click node_camera "https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts"
click node_level_loader "https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts"
click node_campaign "https://github.com/yoshibar-003/code-and-conquer/tree/main/data/campaign_levels/campaign/campaign_solutions_cpp"
click node_main_menu "https://github.com/yoshibar-003/code-and-conquer/tree/main/main_menu/scripts"
click node_assets "https://github.com/yoshibar-003/code-and-conquer/tree/main/assets"

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_workstation,node_editor,node_debug,node_level_editor toneBlue
class node_execution,node_cpp_execution,node_python_execution,node_shared_execution,node_worker toneAmber
class node_game_world,node_robot,node_camera toneMint
class node_level_loader,node_campaign,node_main_menu,node_assets toneRose
class node_player,node_gcc,node_python toneIndigo
```

## Components

### Workstation

- [Code workstation](https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts): `workstation/scripts`
- [Code editor](https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts): `workstation/scripts`
- [Step debugger](https://github.com/yoshibar-003/code-and-conquer/tree/main/workstation/scripts): `workstation/scripts`
- [Level editor](https://github.com/yoshibar-003/code-and-conquer/tree/main/level_editor/scripts): `level_editor/scripts`

### Code Runtime

- [Execution dispatch](https://github.com/yoshibar-003/code-and-conquer/tree/main/execution): `execution`
- [C++ execution](https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/cpp): `execution/cpp`
- [Python execution](https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/python): `execution/python`
- [Shared execution](https://github.com/yoshibar-003/code-and-conquer/tree/main/execution/shared): `execution/shared`
- [Sandbox worker](https://github.com/yoshibar-003/code-and-conquer/blob/main/sandbox_worker/src/main.cpp): `sandbox_worker/src/main.cpp`

### Game World

- [Isometric simulation](https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts): `map/scripts`
- [Robot actions and sensors](https://github.com/yoshibar-003/code-and-conquer/tree/main/player/scripts): `player/scripts`
- [Rotatable camera](https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts): `map/scripts`

### Levels & Assets

- [JSON level loading](https://github.com/yoshibar-003/code-and-conquer/tree/main/map/scripts): `map/scripts`
- [Campaign solutions](https://github.com/yoshibar-003/code-and-conquer/tree/main/data/campaign_levels/campaign/campaign_solutions_cpp): `data/campaign_levels/campaign/campaign_solutions_cpp`
- [Main menu](https://github.com/yoshibar-003/code-and-conquer/tree/main/main_menu/scripts): `main_menu/scripts`
- [Game assets](https://github.com/yoshibar-003/code-and-conquer/tree/main/assets): `assets`

### Other components

- **Player**
- **GCC compiler**
- **Python runtime**

## Connections

- Player → Code workstation: writes code (evidence: `README.md`)
- Code workstation → Code editor: hosts editor (evidence: `README.md`)
- Player → Code workstation: runs or steps (evidence: `README.md`)
- Code workstation → Execution dispatch: dispatches code (evidence: `README.md`)
- Execution dispatch → C++ execution: routes C++
- Execution dispatch → Python execution: routes Python
- C++ execution → Sandbox worker: uses sandbox
- Python execution → Sandbox worker: uses sandbox
- C++ execution → Shared execution: uses shared logic
- Python execution → Shared execution: uses shared logic
- Sandbox worker → GCC compiler: runs compiled code (evidence: `README.md`)
- Sandbox worker → Python runtime: runs student code (evidence: `README.md`)
- Code workstation → Step debugger: synchronizes stepping (evidence: `README.md`)
- Step debugger → Isometric simulation: shows execution (evidence: `README.md`)
- Isometric simulation → Robot actions and sensors: simulates actions
- Player → Level editor: edits levels
- Level editor → JSON level loading: imports JSON (evidence: `README.md`)
- JSON level loading → Isometric simulation: loads level (evidence: `README.md`)
- Player → Rotatable camera: rotates view (evidence: `README.md`)
- Campaign solutions → Robot actions and sensors: uses robot commands (evidence: `data/campaign_levels/campaign/campaign_solutions_cpp/15_labyrinth.cpp`)
- Main menu → Isometric simulation: enters game
- Isometric simulation → Game assets: uses visuals
