# evanval/teampurple-videopoker architecture

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

- Interactive diagram: https://gitdiagram.com/evanval/teampurple-videopoker
- Repository: https://github.com/evanval/teampurple-videopoker

## Overview

##### Project type and purpose
- This is a standalone desktop Video Poker game written in Java, using JavaFX for the UI.
- It follows an MVC-style separation: FXML defines the view, controller classes handle user events, and backend classes contain game logic and data models.

##### File structure
- Top-level Java classes and FXML:
- Main.java – application entry point, boots JavaFX runtime
- VideoPoker.java – core game engine (deals cards, evaluates hands, manages rounds)
- VideoPokerUI.java – JavaFX controller, binds UI actions to game logic
- VideoPoker.fxml – defines the UI layout (buttons, card placeholders, labels)
- Card.java, Player.java, Bank.java – data models for playing cards, player state, and betting bank
- module-info.java – declares the Java module and its JavaFX dependencies
- No external services or databases; all state is held in memory.

##### README
- Confirms it’s a course project implementing video poker.

##### Detail
- Clearly distinguish which classes hold state (model) vs. which respond to events (controller) vs. which perform logic (engine).
- This granularity ensures a comprehensive architectural overview without overthinking external integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs for layers
    subgraph "Presentation Layer"
        direction TB
        VF["VideoPoker.fxml"]:::ui
        VC["VideoPokerUI.java"]:::ui
    end

    subgraph "Application Layer"
        direction TB
        Main["Main.java"]:::engine
        VP["VideoPoker.java"]:::engine
    end

    subgraph "Data Model Layer"
        direction TB
        Card["Card.java"]:::model
        Player["Player.java"]:::model
        Bank["Bank.java"]:::model
    end

    subgraph "Configuration"
        direction TB
        Module["module-info.java"]:::config
    end

    %% Connections
    Main -->|"launch() / initialize"| VC
    VC -->|"loadFXML() / initializeView"| VF
    VC -->|"dealCards() / hold() / draw()"| VP
    VP -->|"updateState() / evaluateHand()"| Card
    VP -->|"updateState() / evaluateHand()"| Player
    VP -->|"updateBank()"| Bank
    Card -->|"stateUpdated"| VC
    Player -->|"stateUpdated"| VC
    Bank -->|"stateUpdated"| VC

    Module -.-> Main
    Module -.-> VC
    Module -.-> VP
    Module -.-> Card
    Module -.-> Player
    Module -.-> Bank

    %% Click Events
    click VF "https://github.com/evanval/teampurple-videopoker/blob/main/VideoPoker.fxml"
    click VC "https://github.com/evanval/teampurple-videopoker/blob/main/VideoPokerUI.java"
    click Main "https://github.com/evanval/teampurple-videopoker/blob/main/Main.java"
    click VP "https://github.com/evanval/teampurple-videopoker/blob/main/VideoPoker.java"
    click Card "https://github.com/evanval/teampurple-videopoker/blob/main/Card.java"
    click Player "https://github.com/evanval/teampurple-videopoker/blob/main/Player.java"
    click Bank "https://github.com/evanval/teampurple-videopoker/blob/main/Bank.java"
    click Module "https://github.com/evanval/teampurple-videopoker/blob/main/module-info.java"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef engine fill:#90EE90,stroke:#333,stroke-width:1px
    classDef model fill:#FFFF99,stroke:#333,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:1px
```
