# lucasppires/jogo-ed architecture

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

- Interactive diagram: https://gitdiagram.com/lucasppires/jogo-ed
- Repository: https://github.com/lucasppires/jogo-ed

## Overview

This repository combines a console burger-serving game with standalone data-structure coursework examples. In the game, a player serves queued customers by looking up and assembling recipe orders, managing ingredient stock, and submitting the burger; scores and measurements are then recorded. The source index identifies the game’s major supporting structures, but most of their implementations were not sampled, so links are limited to calls visible in the game excerpt or references explicitly documented there.

Main entry points: [`src/jogo.cpp`](https://github.com/lucasppires/jogo-ed/blob/main/src/jogo.cpp) (Game loop), [`src/pedido.hpp`](https://github.com/lucasppires/jogo-ed/blob/main/src/pedido.hpp) (Order model), [`src/avl.cpp`](https://github.com/lucasppires/jogo-ed/blob/main/src/avl.cpp) (Order AVL), [`src/hash.cpp`](https://github.com/lucasppires/jogo-ed/blob/main/src/hash.cpp) (Order cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Burger game"]
  node_game_loop["Game loop<br/>[jogo.cpp]"]
  node_menu["Game menu<br/>[funcoes_menu.cpp]"]
  node_ingredients["Ingredient catalog<br/>[ingredientes.cpp]"]
end

subgraph group_orders["Orders and records"]
  node_file_io["File reading"]
  node_pedido["Order model<br/>[pedido.hpp]"]
  node_order_tree["Order AVL<br/>[avl.cpp]"]
  node_order_cache["Order cache<br/>[hash.cpp]"]
  node_history["Game history<br/>[listacontest.cpp]"]
  node_metrics["Measurements<br/>[medicoes.cpp]"]
end

subgraph group_runtime["Game structures"]
  node_customer_queue["Customer queue<br/>[fila.cpp]"]
  node_perishable_stock["Perishable stock<br/>[heap.cpp]"]
  node_burger_stack["Burger stack<br/>[pilha.cpp]"]
  node_recipe_list["Recipe list<br/>[listaenc.cpp]"]
  node_sorting["Game sorting<br/>[sortings.cpp]"]
end

subgraph group_coursework["C coursework examples"]
  node_c_hash["C hash tables<br/>[hash.c]"]
  node_c_avl_splay["C AVL and splay<br/>[avl.c]"]
  node_c_heap["C heap<br/>[heap.c]"]
  node_c_queue["C linked queue<br/>[filaEnc.c]"]
  node_c_stack["C linked stack<br/>[pilhaEnc.c]"]
  node_c_array_list["C array list<br/>[listaContEst.c]"]
  node_c_linked_list["C linked list<br/>[listaEnc.c]"]
  node_c_double_list["C doubly list<br/>[listaDuplaEnc.c]"]
  node_c_sorting["C sorting demo<br/>[ordenacao1.c]"]
end

node_player(("Player"))

node_player -.->|"plays"| node_game_loop
node_game_loop -->|"searches orders"| node_order_tree
node_game_loop -->|"caches lookups"| node_order_cache
node_game_loop -->|"queues customers"| node_customer_queue
node_game_loop -->|"manages stock"| node_perishable_stock
node_game_loop -->|"assembles burger"| node_burger_stack
node_game_loop -->|"looks up ingredients"| node_ingredients
node_game_loop -->|"records score"| node_history
node_game_loop -->|"reports metrics"| node_metrics
node_game_loop -->|"uses menu"| node_menu
node_game_loop -->|"uses sorting"| node_sorting
node_order_tree -->|"stores orders"| node_pedido
node_order_cache -->|"caches orders"| node_pedido
node_pedido -->|"contains recipe"| node_recipe_list
node_game_loop -.->|"loads data"| node_file_io

click node_game_loop "https://github.com/lucasppires/jogo-ed/blob/main/src/jogo.cpp"
click node_menu "https://github.com/lucasppires/jogo-ed/blob/main/src/funcoes_menu.cpp"
click node_ingredients "https://github.com/lucasppires/jogo-ed/blob/main/src/ingredientes.cpp"
click node_file_io "https://github.com/lucasppires/jogo-ed/blob/main/src/leitura_de_arquivos.cpp"
click node_pedido "https://github.com/lucasppires/jogo-ed/blob/main/src/pedido.hpp"
click node_order_tree "https://github.com/lucasppires/jogo-ed/blob/main/src/avl.cpp"
click node_order_cache "https://github.com/lucasppires/jogo-ed/blob/main/src/hash.cpp"
click node_history "https://github.com/lucasppires/jogo-ed/blob/main/src/listacontest.cpp"
click node_metrics "https://github.com/lucasppires/jogo-ed/blob/main/src/medicoes.cpp"
click node_customer_queue "https://github.com/lucasppires/jogo-ed/blob/main/src/fila.cpp"
click node_perishable_stock "https://github.com/lucasppires/jogo-ed/blob/main/src/heap.cpp"
click node_burger_stack "https://github.com/lucasppires/jogo-ed/blob/main/src/pilha.cpp"
click node_recipe_list "https://github.com/lucasppires/jogo-ed/blob/main/src/listaenc.cpp"
click node_sorting "https://github.com/lucasppires/jogo-ed/blob/main/src/sortings.cpp"
click node_c_hash "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/hash/hash.c"
click node_c_avl_splay "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/avl_splay/avl.c"
click node_c_heap "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/heap/heap.c"
click node_c_queue "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/filaEnc/filaEnc.c"
click node_c_stack "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/pilhaEnc/pilhaEnc.c"
click node_c_array_list "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaContEst/listaContEst.c"
click node_c_linked_list "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaEnc/listaEnc.c"
click node_c_double_list "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaDuplaEnc/listaDuplaEnc.c"
click node_c_sorting "https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/ordenacao/ordenacao1.c"

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_loop,node_menu,node_ingredients toneBlue
class node_file_io,node_pedido,node_order_tree,node_order_cache,node_history,node_metrics toneAmber
class node_customer_queue,node_perishable_stock,node_burger_stack,node_recipe_list,node_sorting toneMint
class node_c_hash,node_c_avl_splay,node_c_heap,node_c_queue,node_c_stack,node_c_array_list,node_c_linked_list,node_c_double_list,node_c_sorting toneRose
class node_player toneIndigo
```

## Components

### Burger game

- [Game loop](https://github.com/lucasppires/jogo-ed/blob/main/src/jogo.cpp): `src/jogo.cpp`
- [Game menu](https://github.com/lucasppires/jogo-ed/blob/main/src/funcoes_menu.cpp): `src/funcoes_menu.cpp`
- [Ingredient catalog](https://github.com/lucasppires/jogo-ed/blob/main/src/ingredientes.cpp): `src/ingredientes.cpp`

### Orders and records

- [File reading](https://github.com/lucasppires/jogo-ed/blob/main/src/leitura_de_arquivos.cpp): `src/leitura_de_arquivos.cpp`
- [Order model](https://github.com/lucasppires/jogo-ed/blob/main/src/pedido.hpp): `src/pedido.hpp`
- [Order AVL](https://github.com/lucasppires/jogo-ed/blob/main/src/avl.cpp): `src/avl.cpp`
- [Order cache](https://github.com/lucasppires/jogo-ed/blob/main/src/hash.cpp): `src/hash.cpp`
- [Game history](https://github.com/lucasppires/jogo-ed/blob/main/src/listacontest.cpp): `src/listacontest.cpp`
- [Measurements](https://github.com/lucasppires/jogo-ed/blob/main/src/medicoes.cpp): `src/medicoes.cpp`

### Game structures

- [Customer queue](https://github.com/lucasppires/jogo-ed/blob/main/src/fila.cpp): `src/fila.cpp`
- [Perishable stock](https://github.com/lucasppires/jogo-ed/blob/main/src/heap.cpp): `src/heap.cpp`
- [Burger stack](https://github.com/lucasppires/jogo-ed/blob/main/src/pilha.cpp): `src/pilha.cpp`
- [Recipe list](https://github.com/lucasppires/jogo-ed/blob/main/src/listaenc.cpp): `src/listaenc.cpp`
- [Game sorting](https://github.com/lucasppires/jogo-ed/blob/main/src/sortings.cpp): `src/sortings.cpp`

### C coursework examples

- [C hash tables](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/hash/hash.c): `codigos-moodle/hash/hash.c`
- [C AVL and splay](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/avl_splay/avl.c): `codigos-moodle/avl_splay/avl.c`
- [C heap](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/heap/heap.c): `codigos-moodle/heap/heap.c`
- [C linked queue](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/filaEnc/filaEnc.c): `codigos-moodle/filaEnc/filaEnc.c`
- [C linked stack](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/pilhaEnc/pilhaEnc.c): `codigos-moodle/pilhaEnc/pilhaEnc.c`
- [C array list](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaContEst/listaContEst.c): `codigos-moodle/listaContEst/listaContEst.c`
- [C linked list](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaEnc/listaEnc.c): `codigos-moodle/listaEnc/listaEnc.c`
- [C doubly list](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/listaDuplaEnc/listaDuplaEnc.c): `codigos-moodle/listaDuplaEnc/listaDuplaEnc.c`
- [C sorting demo](https://github.com/lucasppires/jogo-ed/blob/main/codigos-moodle/ordenacao/ordenacao1.c): `codigos-moodle/ordenacao/ordenacao1.c`

### Other components

- **Player**

## Connections

- Player → Game loop: plays
- Game loop → Order AVL: searches orders (evidence: `src/jogo.cpp`)
- Game loop → Order cache: caches lookups (evidence: `src/jogo.cpp`)
- Game loop → Customer queue: queues customers (evidence: `src/jogo.cpp`)
- Game loop → Perishable stock: manages stock (evidence: `src/jogo.cpp`)
- Game loop → Burger stack: assembles burger (evidence: `src/jogo.cpp`)
- Game loop → Ingredient catalog: looks up ingredients (evidence: `src/jogo.cpp`)
- Game loop → Game history: records score (evidence: `src/jogo.cpp`)
- Game loop → Measurements: reports metrics (evidence: `src/jogo.cpp`)
- Game loop → Game menu: uses menu (evidence: `src/jogo.cpp`)
- Game loop → Game sorting: uses sorting (evidence: `src/jogo.cpp`)
- Order AVL → Order model: stores orders
- Order cache → Order model: caches orders
- Order model → Recipe list: contains recipe (evidence: `src/pedido.hpp`)
- Game loop → File reading: loads data
