# adrianpait/ajedrez_info architecture

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

- Interactive diagram: https://gitdiagram.com/adrianpait/ajedrez_info
- Repository: https://github.com/adrianpait/ajedrez_info

## Overview

##### Project type and purpose
- This is a native C++ desktop application implementing a chess game (“ajedrez”).
- It provides a game engine (rules, pieces, board) plus a simple graphical interface (using ETSIDI.h and image assets in the “imagenes” folder).

##### File structure
- Top‐level files:
- Ajedrez.cpp: the entry‐point (main).
- CoordinadorAjedrez.*: central controller orchestrating game flow.
- selector.*: handles user input (piece selection, click events).
- ETSIDI.h: graphics helper library.
- imagenes/: board and piece image assets.
- Domain model (game state):
- Tablero (board), Casilla (square), Vector (position/offset).
- Pieza base class + derived classes (Alfil, Peon, Rey, Torre, Caballo, Dama, Canciller, Arzobispo).
- Utility: Vector.*, data‐structure for 2D coordinates.

##### README
- Minimal; confirms the project is simply “ajedrez_info.” No extra architecture docs provided.

##### Detail level
- Don’t over­fragment; focus on the play loop:
initialization → event handling → state update → render.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Application Layer"
        AJ["Ajedrez.cpp"]:::app
    end

    subgraph "Controller" 
        SEL["selector"]:::ctrl
        COORD["CoordinadorAjedrez"]:::ctrl
    end

    subgraph "Model"
        TAB["Tablero"]:::model
        CAS["Casilla"]:::model
        VEC["Vector"]:::model
        PIEZA["Pieza (base)"]:::model
        PIEZASUB["Pieza Subclasses"]:::model
    end

    subgraph "View/Rendering"
        ETS["ETSIDI.h"]:::view
        IMG["imagenes/"]:::view
    end

    AJ -->|"initializes"| COORD
    SEL -->|"user input"| COORD
    COORD -->|"queries/updates"| TAB
    COORD -->|"queries/updates"| CAS
    COORD -->|"invokes move logic"| PIEZA
    COORD -->|"renders"| ETS
    TAB -->|"uses"| VEC
    PIEZA -->|"uses"| VEC
    ETS -->|"loads assets"| IMG

    click AJ "https://github.com/adrianpait/ajedrez_info/blob/main/Ajedrez.cpp"
    click COORD "https://github.com/adrianpait/ajedrez_info/blob/main/CoordinadorAjedrez.h"
    click SEL "https://github.com/adrianpait/ajedrez_info/blob/main/selector.h"
    click TAB "https://github.com/adrianpait/ajedrez_info/blob/main/Tablero.h"
    click CAS "https://github.com/adrianpait/ajedrez_info/blob/main/Casilla.h"
    click VEC "https://github.com/adrianpait/ajedrez_info/blob/main/Vector.h"
    click PIEZA "https://github.com/adrianpait/ajedrez_info/blob/main/Pieza.h"
    click ETS "https://github.com/adrianpait/ajedrez_info/blob/main/ETSIDI.h"
    click IMG "https://github.com/adrianpait/ajedrez_info/tree/main/imagenes/"

    classDef app fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef ctrl fill:#9f6,stroke:#333,stroke-width:1px
    classDef model fill:#89CFF0,stroke:#333,stroke-width:1px
    classDef view fill:#FFA500,stroke:#333,stroke-width:1px
```
