# tafursj17/project-chees architecture

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

- Interactive diagram: https://gitdiagram.com/tafursj17/project-chees
- Repository: https://github.com/tafursj17/project-chees

## Overview

##### Project’s Main Parts
- Game Engine/Controller: In charge of running the simulation. This includes the core game logic (CheesGame), configuration parameters (CheesGameParameters), and the main class that initiates and orchestrates the game.
- Sorting Algorithms Module: Contains several algorithm implementations (BubbleSort, InsertionSort, QuickSort) and an interface (Algorithm) to ensure they can be swapped or extended per SOLID’s Open-Closed Principle.
- Visualization Component: “SortingVisualization” and related classes show the step-by-step changes on the board (“tablero”) that represent the state of the game during sorting.
- Domain Models & Enumerations: Classes in the Enums package (CharacterList, NumberList, PieceColor, ValueType) and other domain-specific classes (e.g., ChoosePiecesCharacter, ChoosePiecesNumeric) capture the rules and settings for identifying chess pieces.
- Testing: A separate test module (ChessGameTest) ensures that the core logic works as expected.

##### Out Relationships and Dependencies
- The Visualization Component is tightly linked with the game engine and sorting modules – it receives and displays the changes in board state as sorting steps are executed.
- Domain models (like those found in the Enums package and ChoosePieces classes) provide configuration and state information to both the sorting component and game engine.

##### Architectural Patterns & Design Principles
- Object-Oriented Design: Emphasize the use of interfaces (i.e., Algorithm) and encapsulated classes (CheesGame, SortingVisualization).
- Modular Packaging: Display how packages and subdirectories (e.g., Main, Algorithms, Enums, Interface) contribute separate concerns.

##### Relevant Technologies & Frameworks
- Java is the core technology.
- That while this is not a web or microservices app, the separation internally resembles a layered architecture.

- CLI / Argument Parser handling user inputs.
- Game Controller/Engine (CheesGame & CheesGameParameters).
- Sorting Algorithms Interface and its implementations (BubbleSort, InsertionSort, QuickSort).
- Visualization component (SortingVisualization).
- Domain Models & Enums.
- Test Component (ChessGameTest) – where applicable.

##### Putting It Together

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Chees Simulator"
        %% Input Layer
        subgraph "Input Layer"
            CLI["Command-Line Interface / Argument Parser"]:::cli
        end

        %% Logic Layer
        subgraph "Logic Layer"
            GE["Game Engine (CheesGame)"]:::engine
            GP["Game Parameters (CheesGameParameters)"]:::engine

            AlgInterface["Algorithm Interface"]:::algorithm
            subgraph "Sorting Algorithms"
                BubbleSort["BubbleSort Implementation"]:::algorithm
                InsertionSort["InsertionSort Implementation"]:::algorithm
                QuickSort["QuickSort Implementation"]:::algorithm
            end

            subgraph "Domain Models & Enums"
                CharacterList["CharacterList Enum"]:::domain
                NumberList["NumberList Enum"]:::domain
                PieceColor["PieceColor Enum"]:::domain
                ValueType["ValueType Enum"]:::domain
                ChoosePiecesCharacter["ChoosePiecesCharacter"]:::domain
                ChoosePiecesNumeric["ChoosePiecesNumeric"]:::domain
            end
        end

        %% Output Layer
        subgraph "Output Layer"
            SortingVisualization["Sorting Visualization"]:::visual
        end

        %% Testing Component outside layers
        ChessGameTest["Testing Component (ChessGameTest)"]:::test
    end

    %% Connections
    CLI -->|"configuration"| GE
    CLI -->|"configuration"| GP
    GE -->|"configures"| GP
    GE -->|"selectsAlgorithm"| AlgInterface
    AlgInterface -.->|"implementedBy"| BubbleSort
    AlgInterface -.->|"implementedBy"| InsertionSort
    AlgInterface -.->|"implementedBy"| QuickSort
    GE -->|"triggersStateUpdate"| SortingVisualization
    GE -->|"usesDomain"| CharacterList
    GE -->|"usesDomain"| NumberList
    GE -->|"usesDomain"| PieceColor
    GE -->|"usesDomain"| ValueType
    GE -->|"usesDomain"| ChoosePiecesCharacter
    GE -->|"usesDomain"| ChoosePiecesNumeric
    ChessGameTest -->|"tests"| GE

    %% Click Events
    click CLI "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Main.java"
    click GE "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/CheesGame.java"
    click GP "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/CheesGameParameters.java"
    click BubbleSort "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/Algorithms/BubbleSort.java"
    click InsertionSort "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/Algorithms/InsertionSort.java"
    click QuickSort "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/Algorithms/QuickSort.java"
    click AlgInterface "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Interface/Algorithm.java"
    click SortingVisualization "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/SortingVisualization.java"
    click CharacterList "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Enums/CharacterList.java"
    click NumberList "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Enums/NumberList.java"
    click PieceColor "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Enums/PieceColor.java"
    click ValueType "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Enums/ValueType.java"
    click ChoosePiecesCharacter "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/ChoosePiecesCharacter.java"
    click ChoosePiecesNumeric "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/Main/Class/ChoosePiecesNumeric.java"
    click ChessGameTest "https://github.com/tafursj17/project-chees/blob/main/src/jala/jala/university/chees/test/ChessGameTest.java"

    %% Styles
    classDef cli fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef engine fill:#FFCDD2,stroke:#B71C1C,stroke-width:2px;
    classDef algorithm fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef visual fill:#D1C4E9,stroke:#4A148C,stroke-width:2px;
    classDef domain fill:#FFF9C4,stroke:#F57F17,stroke-width:2px;
    classDef test fill:#FFE0B2,stroke:#E65100,stroke-width:2px;
```
