# josejesusoh/patolli-game-java-c architecture

> Architecture diagram of the GitHub repository josejesusoh/patolli-game-java-c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/josejesusoh/patolli-game-java-c
- Repository: https://github.com/josejesusoh/patolli-game-java-c

## Overview

##### Project type and purpose
- This is a desktop-based, multi-module Java implementation of the Patolli board game with a client–server architecture.
- It uses MVC on the client side, a shared domain model library, and a server engine that runs game sessions.

##### File structure
- Top-level modules:
- dominioPatolli – domain layer containing plain Java entities (Casilla, Dado, Jugador, Partida, etc.).
- clientePatolli – client application (NetBeans project) organized into MVC:
– src/clientePatolli – entry point (Cliente.java)
– src/control – controllers (CJugador, CPartida, CValidacion, ControlBase)
– src/modelo – client-side models (MJugador, MPartida, MValidacion, ModeloBase)
– src/presentacion – view layer, subdivided into dibujo (Canvas-style drawing classes) and vista (Swing forms and frames)
- servidorPatolli – server application (NetBeans project) organized into:
– src/controlServidor – server-side protocol handler (ProtocoloPartida)
– src/modeloServidor – server-side game state (PartidaServidor)
– src/jugador – player façade for local use (JugadorLocal)
– src/servidorPatolli – main server launcher (Servidor.java, Prueba.java)

- Build and config files: build.xml, manifest.mf, nbproject indicate separate NetBeans modules.

##### README for additional insights
- Confirms MVC architecture in Java, future C++ port.
- Focus is on game logic, UI, and networked play.

##### Elements
- Blue for UI components
- Green for control/business logic
- Yellow for domain entities
- Orange for network/protocol

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Domain Library
    subgraph "Domain Library"
        DomainEntities["Domain Entities\n(Casilla, Dado, Jugador, Partida, etc.)"]:::domain
    end
    click DomainEntities "https://github.com/josejesusoh/patolli-game-java-c/tree/main/dominioPatolli/src/entidades"

    %% Client Application MVC
    subgraph "Client Application (MVC)"
        Cliente["Entry: Cliente.java"]:::controller
        subgraph "View (UI)"
            Drawing["Drawing Layer"]:::ui
            Swing["Swing Forms & Frames"]:::ui
        end
        subgraph "Controllers"
            CJugador["CJugador"]:::controller
            CPartida["CPartida"]:::controller
            CValidacion["CValidacion"]:::controller
            ControlBase["ControlBase"]:::controller
        end
        subgraph "Client Models"
            MJugador["MJugador"]:::domain
            MPartida["MPartida"]:::domain
            MValidacion["MValidacion"]:::domain
            ModeloBase["ModeloBase"]:::domain
        end
    end
    click Cliente "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/clientePatolli/Cliente.java"
    click CJugador "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/control/CJugador.java"
    click CPartida "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/control/CPartida.java"
    click CValidacion "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/control/CValidacion.java"
    click ControlBase "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/control/ControlBase.java"
    click MJugador "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/modelo/MJugador.java"
    click MPartida "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/modelo/MPartida.java"
    click MValidacion "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/modelo/MValidacion.java"
    click ModeloBase "https://github.com/josejesusoh/patolli-game-java-c/blob/main/clientePatolli/src/modelo/ModeloBase.java"
    click Drawing "https://github.com/josejesusoh/patolli-game-java-c/tree/main/clientePatolli/src/presentacion/dibujo"
    click Swing "https://github.com/josejesusoh/patolli-game-java-c/tree/main/clientePatolli/src/presentacion/vista"

    %% Networking Layer
    ProtocolClient["Client Protocol\n(ProtocoloPartida)"]:::network

    %% Server Engine
    subgraph "Server Engine"
        MainLauncher["Servidor / Prueba"]:::controller
        NetworkListener["Network Listener"]:::network
        ProtocolHandler["ProtocoloPartida"]:::network
        PartidaServidor["PartidaServidor"]:::domain
        JugadorLocal["JugadorLocal"]:::controller
    end
    click MainLauncher "https://github.com/josejesusoh/patolli-game-java-c/blob/main/servidorPatolli/src/servidorPatolli/Servidor.java"
    click ProtocolHandler "https://github.com/josejesusoh/patolli-game-java-c/blob/main/servidorPatolli/src/controlServidor/ProtocoloPartida.java"
    click PartidaServidor "https://github.com/josejesusoh/patolli-game-java-c/blob/main/servidorPatolli/src/modeloServidor/PartidaServidor.java"
    click JugadorLocal "https://github.com/josejesusoh/patolli-game-java-c/blob/main/servidorPatolli/src/jugador/JugadorLocal.java"

    %% Connections
    Cliente -->|"starts"| CJugador
    Cliente -->|"starts"| CPartida
    Cliente -->|"starts"| CValidacion
    Cliente -->|"starts"| ControlBase

    Drawing <-->|"interacts"| CJugador
    Swing <-->|"interacts"| CJugador
    CJugador -->|"updates"| MJugador
    CPartida -->|"updates"| MPartida
    CValidacion -->|"validates"| MValidacion
    ControlBase -->|"common logic"| ModeloBase

    MJugador -->|"uses"| DomainEntities
    MPartida -->|"uses"| DomainEntities
    MValidacion -->|"uses"| DomainEntities
    ModeloBase -->|"uses"| DomainEntities

    CJugador -->|"calls protocol"| ProtocolClient
    CPartida -->|"calls protocol"| ProtocolClient
    CValidacion -->|"calls protocol"| ProtocolClient

    ProtocolClient -->|"TCP/UDP"| ProtocolHandler
    ProtocolHandler -->|"manages session"| PartidaServidor
    PartidaServidor -->|"façade"| JugadorLocal
    PartidaServidor -->|"uses"| DomainEntities

    ProtocolHandler -->|"response"| CJugador
    ProtocolHandler -->|"response"| CPartida
    ProtocolHandler -->|"response"| CValidacion

    MainLauncher -->|"launches"| NetworkListener
    NetworkListener -->|"forwards"| ProtocolHandler

    %% Styles
    classDef ui fill:#AED6F1,stroke:#333,stroke-width:1px
    classDef controller fill:#ABEBC6,stroke:#333,stroke-width:1px
    classDef domain fill:#F9E79F,stroke:#333,stroke-width:1px
    classDef network fill:#F5B041,stroke:#333,stroke-width:1px
```
