# qaehak/poke-tactoe architecture

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

- Interactive diagram: https://gitdiagram.com/qaehak/poke-tactoe
- Repository: https://github.com/qaehak/poke-tactoe

## Overview

##### Main Components

a. User Interface Layer
- Splash Screen Activity
- Game Setup Activity
- Game Screen Activity
- UI components:
- Buttons (Reset, Undo/Redo)
- TextViews
- EditText fields
- ImageViews (for Pokemon pieces)
- Spinners
- ScrollView

b. Game Logic Layer
- Game State Manager
- Move History Manager (for undo/redo functionality)
- Pokemon Evolution Handler
- Win Condition Checker
- Board State Controller

c. Data Persistence Layer
- File Storage Manager (for save game functionality)
- Exception Handler

##### Component Relationships

- User input flow from UI to Game Logic
- Game state updates from Logic to UI
- Data saving/loading between Logic and Persistence layers
- Event handling between components

##### Technical Details

- Android Activity lifecycle integration
- Toast notification system
- AlertDialog implementation
- File I/O operations
- Exception handling paths

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef ui fill:#a8d1f0,stroke:#2980b9
    classDef logic fill:#a8e6cf,stroke:#27ae60
    classDef data fill:#ffd3b6,stroke:#d35400
    classDef critical stroke:#e74c3c,stroke-width:3px
    
    %% UI Layer
    subgraph UI["User Interface Layer"]
        Splash["Splash Screen Activity"]:::ui
        Setup["Game Setup Activity"]:::ui
        Game["Game Screen Activity"]:::ui
        
        subgraph UIComponents["UI Components"]
            Buttons["Game Control Buttons<br/>(Reset, Undo/Redo)"]:::ui
            TextView["Text Displays<br/>(Player Info, Status)"]:::ui
            EditText["Input Fields"]:::ui
            ImageView["Pokemon Images"]:::ui
            Spinner["Selection Spinners"]:::ui
            ScrollView["Scrollable Views"]:::ui
        end
    end
    
    %% Game Logic Layer
    subgraph Logic["Game Logic Layer"]
        GameState["Game State Manager"]:::logic
        MoveHistory["Move History Manager"]:::logic
        Evolution["Pokemon Evolution Handler"]:::logic
        WinCheck["Win Condition Checker"]:::logic
        BoardControl["Board State Controller"]:::logic
    end
    
    %% Data Layer
    subgraph Data["Data Persistence Layer"]
        Storage["File Storage Manager"]:::data
        ErrorHandler["Exception Handler"]:::data
    end
    
    %% Relationships
    Splash --> Setup
    Setup --> Game
    Game --> UIComponents
    
    UIComponents --> GameState
    GameState --> BoardControl
    BoardControl --> WinCheck
    BoardControl --> Evolution
    GameState --> MoveHistory
    
    GameState --> Storage
    Storage --> ErrorHandler
    ErrorHandler --> Game
    
    %% Critical Paths
    GameState --> Game:::critical
    BoardControl --> GameState:::critical
    
    %% Legend
    subgraph Legend
        UI_Legend["UI Component"]:::ui
        Logic_Legend["Logic Component"]:::logic
        Data_Legend["Data Component"]:::data
        Critical_Legend["Critical Path"]:::critical
    end
```
