# stefanopalmieri/pegthing-axialized architecture

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

- Interactive diagram: https://gitdiagram.com/stefanopalmieri/pegthing-axialized
- Repository: https://github.com/stefanopalmieri/pegthing-axialized

## Overview

##### Main Components

a. Core Game Engine
- This as the central component
- Coordinate system management
- Board state management

b. Input/Output System
- Command-line interface
- Game state display
- User input handling

c. Game Logic Components
- Board generation
- Move validation
- Game state evaluation

**┌─────────────────────────────────────────┐**
- Game System                │

- ┌─────────────┐      ┌──────────────┐ │
- Core     │◄────►│     I/O      │ │
- Engine    │      │   Handler    │ │
- ┘      └──────────────┘ │
- ▲                              │

- ┌─────────────┐                       │
- Coordinate │                       │
- System    │                       │
- ┘                       │
- ┘

##### Key Elements to Emphasize

a. Coordinate System (Critical Component):
- Axialized hex-grid coordinate system
- How it interfaces with the core game logic
- Coordinate transformation functions

b. Game State Management:
- Board representation
- Move validation
- State transitions

c. User Interaction Flow:
- Command input processing
- Game state display
- Move execution

##### Implementation Details

a. Core Functions:
- Board initialization
- Move validation
- Game state updates
- Victory condition checking

b. Data Structures:
- Hex-grid representation
- Game state structure
- Move representation

##### Technical Stack Indicators
- Clojure runtime
- Leiningen project structure
- REPL integration

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph GameSystem["Game System"]
        direction TB
        
        subgraph CoreEngine["Core Game Engine"]
            direction TB
            BoardState["Board State Management"]
            MoveValidation["Move Validation"]
            GameStateEval["Game State Evaluation"]
            BoardGen["Board Generation"]
        end
        
        subgraph IOSystem["Input/Output System"]
            direction TB
            CLI["Command Line Interface"]
            Display["Game State Display"]
            InputHandler["User Input Handler"]
        end
        
        subgraph CoordSystem["Coordinate System"]
            direction TB
            AxialCoord["Axialized Hex-Grid"]
            CoordTransform["Coordinate Transformation"]
        end
        
        subgraph Support["Support Components"]
            direction TB
            Tests["Test Suite"]
            Config["Project Configuration"]
            Docs["Documentation"]
            Tasks["Development Tasks"]
        end
        
        %% Relationships
        CoreEngine --> IOSystem
        CoordSystem --> CoreEngine
        IOSystem --> Display
        CLI --> InputHandler
        InputHandler --> CoreEngine
        BoardState --> GameStateEval
        AxialCoord --> CoordTransform
        
        %% Click events for component mapping
        click CoreEngine "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/src/pegthing/core.clj"
        click IOSystem "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/src/pegthing/core.clj"
        click BoardState "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/src/pegthing/core.clj"
        click MoveValidation "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/src/pegthing/core.clj"
        click GameStateEval "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/src/pegthing/core.clj"
        click Tests "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/test/pegthing/core_test.clj"
        click Config "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/project.clj"
        click Docs "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/doc/intro.md"
        click Tasks "https://github.com/stefanopalmieri/pegthing-axialized/blob/master/doc/todo.org"
        
        %% Styling
        classDef core fill:#a8d1f0,stroke:#333,stroke-width:2px
        classDef io fill:#90EE90,stroke:#333,stroke-width:2px
        classDef coord fill:#FFB347,stroke:#333,stroke-width:2px
        classDef support fill:#E6E6FA,stroke:#333,stroke-width:2px
        
        class CoreEngine,BoardState,MoveValidation,GameStateEval,BoardGen core
        class IOSystem,CLI,Display,InputHandler io
        class CoordSystem,AxialCoord,CoordTransform coord
        class Support,Tests,Config,Docs,Tasks support
    end
    
    %% Legend
    subgraph Legend
        CoreComp["Core Components"]:::core
        IOComp["I/O Components"]:::io
        CoordComp["Coordinate System"]:::coord
        SupportComp["Support Components"]:::support
    end
```
