# hadrianuslima06/rpg-c-tabuleiro architecture

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

- Interactive diagram: https://gitdiagram.com/hadrianuslima06/rpg-c-tabuleiro
- Repository: https://github.com/hadrianuslima06/rpg-c-tabuleiro

## Overview

Setor Alfa is a C99, turn-based terminal game. The player names and configures an android, then traverses three phases, collecting required credentials in later phases and fighting ordinary enemies and a boss to advance; battery loss ends the run. `main` coordinates the run, while map events dispatch combat and character updates. The README also documents class abilities, rewards, upgrades and phase-specific objectives. The map and combat excerpts are partial, so the graph omits unshown details and does not infer links between subsystems.

Main entry points: [`src/main.c`](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/main.c) (Run coordinator), [`src/mapa.c`](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/mapa.c) (Phase map and events), [`src/personagem.c`](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/personagem.c) (Class and progression), [`src/combate.c`](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/combate.c) (Enemy and boss combat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Game flow"]
  node_main["Run coordinator<br/>[main.c]"]
end

subgraph group_world["Phase exploration"]
  node_phase["Phase map and events<br/>[mapa.c]"]
end

subgraph group_combat["Combat system"]
  node_combat_logic["Enemy and boss combat<br/>[combate.c]"]
end

subgraph group_unit["Android and interface"]
  node_unit_logic["Class and progression<br/>[personagem.c]"]
  node_terminal["Terminal interaction<br/>[terminal.c]"]
  node_model["Game data types<br/>[estruturas.h]"]
end

node_player(("Player"))

node_player -->|"plays"| node_main
node_main -->|"shows prologue"| node_terminal
node_main -->|"creates android"| node_unit_logic
node_main -->|"initializes and runs phases"| node_phase
node_main -->|"shows phase story"| node_phase
node_main -->|"checks battery"| node_unit_logic
node_main -->|"shows ending"| node_phase
node_phase -->|"dispatches fights"| node_combat_logic
node_phase -->|"updates and displays android"| node_unit_logic
node_phase -->|"uses input and pauses"| node_terminal
node_combat_logic -->|"updates character"| node_unit_logic
node_combat_logic -->|"uses input and pauses"| node_terminal
node_unit_logic -->|"reads class choice"| node_terminal
node_unit_logic -->|"uses combat die"| node_combat_logic

click node_main "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/main.c"
click node_phase "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/mapa.c"
click node_combat_logic "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/combate.c"
click node_unit_logic "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/personagem.c"
click node_terminal "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/terminal.c"
click node_model "https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/include/estruturas.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_main toneBlue
class node_phase toneAmber
class node_combat_logic toneMint
class node_unit_logic,node_terminal,node_model toneRose
class node_player toneIndigo
```

## Components

### Game flow

- [Run coordinator](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/main.c): `src/main.c`

### Phase exploration

- [Phase map and events](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/mapa.c): `src/mapa.c`

### Combat system

- [Enemy and boss combat](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/combate.c): `src/combate.c`

### Android and interface

- [Class and progression](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/personagem.c): `src/personagem.c`
- [Terminal interaction](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/src/terminal.c): `src/terminal.c`
- [Game data types](https://github.com/hadrianuslima06/rpg-c-tabuleiro/blob/main/include/estruturas.h): `include/estruturas.h`

### Other components

- **Player**

## Connections

- Player → Run coordinator: plays (evidence: `README.md`)
- Run coordinator → Terminal interaction: shows prologue (evidence: `src/main.c`)
- Run coordinator → Class and progression: creates android (evidence: `src/main.c`)
- Run coordinator → Phase map and events: initializes and runs phases (evidence: `src/main.c`)
- Run coordinator → Phase map and events: shows phase story (evidence: `src/main.c`)
- Run coordinator → Class and progression: checks battery (evidence: `src/main.c`)
- Run coordinator → Phase map and events: shows ending (evidence: `src/main.c`)
- Phase map and events → Enemy and boss combat: dispatches fights (evidence: `src/mapa.c`)
- Phase map and events → Class and progression: updates and displays android (evidence: `src/mapa.c`)
- Phase map and events → Terminal interaction: uses input and pauses (evidence: `src/mapa.c`)
- Enemy and boss combat → Class and progression: updates character (evidence: `src/combate.c`)
- Enemy and boss combat → Terminal interaction: uses input and pauses (evidence: `src/combate.c`)
- Class and progression → Terminal interaction: reads class choice (evidence: `src/personagem.c`)
- Class and progression → Enemy and boss combat: uses combat die (evidence: `src/personagem.c`)
