# cassio7/trannoi architecture

> Architecture diagram of the GitHub repository cassio7/trannoi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cassio7/trannoi
- Repository: https://github.com/cassio7/trannoi

## Overview

##### Project type and purpose
- From the README and file tree, this is a small, procedural C “game engine” for an Among-Us-style text game. It consists of:
- a main driver (main.c)
- a reusable game library (gamelib.c/.h)
- a requirements/spec PDF (Testo del progetto.pdf)
- It is neither a web app nor microservices – it’s a single‐process, console‐based game implemented in C using procedural modules.

##### File structure
- Top level:
- gamelib.h / gamelib.c: core game logic and state management
- main.c: entry point, I/O loop, orchestrates calls into gamelib
- README.md / Testo del progetto.pdf: documentation/spec
- .gitignore

##### Key insights from the README
- The library implements:
- Player roles (impostors, astronauts)
- Room graph (normal rooms, botola rooms, quest rooms)
- Actions: move, use_botola, sabotaggio, chiamata_emergenza
- Two minigames (quest_semplice, quest_complicata)
- Victory conditions and probability rules are defined in the library.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface
    UI["Console I/O (User Interface)"]:::ui
    %% Control Layer
    Driver["Game Driver (main.c)"]:::control
    %% Core Logic
    subgraph "Core Logic (GameLib)"
        Interface["Game Library Interface"]:::core
        Impl["Game Library Implementation"]:::core
    end
    %% Data Structures
    Data["Game State Data Structures"]:::data
    %% Documentation
    subgraph "Project Documentation"
        README["README.md"]:::doc
        Spec["Testo del progetto.pdf"]:::doc
        Gitignore[".gitignore"]:::doc
    end

    %% Connections
    UI -->|"reads user commands"| Driver
    Driver -->|"calls API"| Interface
    Interface -->|"declares functions"| Impl
    Impl -->|"updates/reads state"| Data
    Impl -->|"returns results"| Driver
    Driver -->|"prints game state"| UI

    %% Click Events
    click UI "https://github.com/cassio7/trannoi/blob/main/main.c"
    click Driver "https://github.com/cassio7/trannoi/blob/main/main.c"
    click Interface "https://github.com/cassio7/trannoi/blob/main/gamelib.h"
    click Impl "https://github.com/cassio7/trannoi/blob/main/gamelib.c"
    click Data "https://github.com/cassio7/trannoi/blob/main/gamelib.h"
    click README "https://github.com/cassio7/trannoi/blob/main/README.md"
    click Spec "https://github.com/cassio7/trannoi/blob/main/Testo del progetto.pdf"
    click Gitignore "https://github.com/cassio7/trannoi/blob/main/.gitignore"

    %% Styles
    classDef ui fill:#b2fdb2,stroke:#088A08,color:#000
    classDef control fill:#b2d8fd,stroke:#085394,color:#000
    classDef core fill:#ffd59e,stroke:#d35400,color:#000
    classDef data fill:#d3d3d3,stroke:#7f8c8d,color:#000
    classDef doc fill:#f2f2f2,stroke:#bdc3c7,color:#000
```
