# julianventura/tp-final-taller architecture

> Architecture diagram of the GitHub repository julianventura/tp-final-taller, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/julianventura/tp-final-taller
- Repository: https://github.com/julianventura/tp-final-taller

## Overview

##### Main System Components

a) Client Side (cliente/)
- GUI Layer (vista/)
- Controller Layer (controlador/)
- Model Layer (modelo/)
- Audio System (lib/audio)
- Asset Management (assets/)

b) Server Side (servidor/)
- Game Logic (Clases/)
- Database Integration
- Client Management
- Room Management
- Physics/Collision System

c) Common Components (common/)
- Network Protocol
- Message Queue System
- Threading Utilities

**[Client] <-----> [Network Layer] <-----> [Server]**

**[GUI Layer]**
- ↑↓
**[Controller Layer]**
- ↑↓
**[Model Layer] <---> [Audio System]**
- ↑↓
**[Network Interface]**

**[Client Manager] <---> [Room Manager]**
- ↑                    ↑
**[Game Logic] <---------> [Physics]**
- ↓                    ↓
**[Entity System] <---> [Database]**

##### Important Relationships to Highlight

- Client-Server Communication Flow
- MVC Pattern in Client
- Entity Management System
- Game State Synchronization
- Asset Management Flow
- Audio System Integration

##### Implementation Details

- The separation between client and server
- The MVC architecture in the client
- The room-based multiplayer system
- The entity component system
- The network protocol layer
- The asset management system

##### Additional Notes

- Database interactions for character persistence
- Audio system integration
- Detail the asset loading pipeline
- Threading model for network operations

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        GUI["GUI Layer"]
        Controller["Controller Layer"]
        Model["Model Layer"]
        Audio["Audio System"]
        Assets["Asset Management"]
        Chat["Chat System"]
        
        GUI --> Controller
        Controller --> Model
        Model --> Audio
        Model --> Assets
        GUI --> Chat
    end

    subgraph Server
        GameLogic["Game Logic"]
        Database["Database Integration"]
        ClientMgr["Client Management"]
        RoomMgr["Room Management"]
        Physics["Physics/Collision"]
        Entity["Entity System"]
        State["State Management"]
        Combat["Combat System"]
        Inventory["Inventory System"]
        Trading["Trading System"]
        
        ClientMgr <--> RoomMgr
        GameLogic <--> Physics
        GameLogic --> Entity
        Entity <--> Database
        GameLogic --> State
        Combat --> GameLogic
        Inventory --> Entity
        Trading --> GameLogic
    end

    subgraph Common
        Network["Network Protocol"]
        MessageQueue["Message Queue"]
        Threading["Threading Utilities"]
        
        Network <--> MessageQueue
        MessageQueue <--> Threading
    end

    Client <--> Network
    Network <--> Server

    classDef default fill:#f9f,stroke:#333,stroke-width:2px
    classDef client fill:#a8d1ff,stroke:#333
    classDef server fill:#90EE90,stroke:#333
    classDef common fill:#FFE5B4,stroke:#333
    
    class GUI,Controller,Model,Audio,Assets,Chat client
    class GameLogic,Database,ClientMgr,RoomMgr,Physics,Entity,State,Combat,Inventory,Trading server
    class Network,MessageQueue,Threading common

    click GUI "https://github.com/JulianVentura/TP-Final-Taller/tree/master/cliente/vista/"
    click Controller "https://github.com/JulianVentura/TP-Final-Taller/tree/master/cliente/controlador/"
    click Model "https://github.com/JulianVentura/TP-Final-Taller/tree/master/cliente/modelo/"
    click Audio "https://github.com/JulianVentura/TP-Final-Taller/blob/master/cliente/lib/audio.h"
    click Assets "https://github.com/JulianVentura/TP-Final-Taller/tree/master/cliente/assets/"
    click GameLogic "https://github.com/JulianVentura/TP-Final-Taller/tree/master/servidor/Clases/"
    click Database "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/BaseDeDatos.h"
    click ClientMgr "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/OrganizadorClientes.h"
    click RoomMgr "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/OrganizadorSalas.h"
    click Physics "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/Quadtree.h"
    click Network "https://github.com/JulianVentura/TP-Final-Taller/blob/master/common/commonProtocolo.h"
    click MessageQueue "https://github.com/JulianVentura/TP-Final-Taller/blob/master/common/ColaBloqueanteMensajes.h"
    click Threading "https://github.com/JulianVentura/TP-Final-Taller/blob/master/common/Thread.h"
    click Entity "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/Entidad.h"
    click State "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/Estado.h"
    click Combat "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/OperacionAtacar.h"
    click Inventory "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/Inventario.h"
    click Trading "https://github.com/JulianVentura/TP-Final-Taller/blob/master/servidor/Clases/Comerciante.h"
    click Chat "https://github.com/JulianVentura/TP-Final-Taller/blob/master/cliente/vista/GUI_Chat.h"
```
