# daniillishankov-alt/xpoker architecture

> Architecture diagram of the GitHub repository daniillishankov-alt/xpoker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daniillishankov-alt/xpoker
- Repository: https://github.com/daniillishankov-alt/xpoker

## Overview

XPoker is a console poker game where a player starts a round, manages an eight-card hand, selects or discards cards, plays hands to reach a score target, and can buy enhancements between rounds. Program creates the session and ViewModel; the ViewModel coordinates game state, deck operations, hand evaluation, shop actions, scoring, and console interaction. The graph reflects relationships visible in excerpts and SOURCE INDEX references; unsampled implementation details and README capabilities cannot be verified because no README content was provided.

Main entry points: [`XPoker/ViewModel.cs`](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/ViewModel.cs) (Game controller), [`XPoker/Program.cs`](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Program.cs) (Game entry), [`XPoker/HandEvaluator.cs`](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/HandEvaluator.cs) (Hand evaluator), [`XPoker/GameSession.cs`](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/GameSession.cs) (Session state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_program["Game entry<br/>[Program.cs]"]
  node_viewmodel["Game controller<br/>[ViewModel.cs]"]
  node_session["Session state<br/>[GameSession.cs]"]
end

subgraph group_cards["Cards and scoring"]
  node_deck["Deck and draws<br/>[Deck.cs]"]
  node_cardtypes["Card types<br/>[ICard.cs]"]
  node_handtypes["Hand rules<br/>[IHandType.cs]"]
  node_evaluator["Hand evaluator<br/>[HandEvaluator.cs]"]
  node_handrank["Hand ranks<br/>[EnumHandRank.cs]"]
  node_rank["Card ranks<br/>[EnumRank.cs]"]
  node_suit["Card suits<br/>[EnumSuit.cs]"]
end

subgraph group_progression["Shop and progression"]
  node_shop["Enhancement shop<br/>[Shop.cs]"]
  node_enhancement["Enhancements<br/>[Enhancement.cs]"]
end

subgraph group_console["Console interface"]
  node_scorebreakdown["Score breakdown<br/>[ScoreBreakdown.cs]"]
  node_consolehelper["Console formatting<br/>[ConsoleHelper.cs]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_program
node_program -->|"creates session"| node_session
node_program -->|"starts controller"| node_viewmodel
node_viewmodel -->|"updates state"| node_session
node_viewmodel -->|"draws cards"| node_deck
node_viewmodel -->|"requests items"| node_shop
node_viewmodel -->|"evaluates hand"| node_evaluator
node_viewmodel -->|"builds breakdown"| node_scorebreakdown
node_deck -->|"deals cards"| node_cardtypes
node_evaluator -->|"checks rules"| node_handtypes
node_evaluator -->|"reads cards"| node_cardtypes
node_shop -->|"offers items"| node_enhancement
node_session -->|"applies purchase"| node_enhancement
node_consolehelper -->|"formats details"| node_scorebreakdown

click node_program "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Program.cs"
click node_viewmodel "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/ViewModel.cs"
click node_session "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/GameSession.cs"
click node_deck "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Deck.cs"
click node_cardtypes "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/ICard.cs"
click node_handtypes "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/IHandType.cs"
click node_evaluator "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/HandEvaluator.cs"
click node_handrank "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/EnumHandRank.cs"
click node_rank "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/EnumRank.cs"
click node_suit "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/EnumSuit.cs"
click node_shop "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Shop.cs"
click node_enhancement "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/Enhancement.cs"
click node_scorebreakdown "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/UI/ScoreBreakdown.cs"
click node_consolehelper "https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/UI/ConsoleHelper.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_viewmodel,node_session toneBlue
class node_deck,node_cardtypes,node_handtypes,node_evaluator,node_handrank,node_rank,node_suit toneAmber
class node_shop,node_enhancement toneMint
class node_scorebreakdown,node_consolehelper toneRose
class node_player toneIndigo
```

## Components

### Game runtime

- [Game entry](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Program.cs): `XPoker/Program.cs`
- [Game controller](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/ViewModel.cs): `XPoker/ViewModel.cs`
- [Session state](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/GameSession.cs): `XPoker/GameSession.cs`

### Cards and scoring

- [Deck and draws](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Deck.cs): `XPoker/Deck.cs`
- [Card types](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/ICard.cs): `XPoker/ICard.cs`
- [Hand rules](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/IHandType.cs): `XPoker/IHandType.cs`
- [Hand evaluator](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/HandEvaluator.cs): `XPoker/HandEvaluator.cs`
- [Hand ranks](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/EnumHandRank.cs): `XPoker/Enums/EnumHandRank.cs`
- [Card ranks](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/EnumRank.cs): `XPoker/Enums/EnumRank.cs`
- [Card suits](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/EnumSuit.cs): `XPoker/EnumSuit.cs`

### Shop and progression

- [Enhancement shop](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Shop.cs): `XPoker/Shop.cs`
- [Enhancements](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/Enums/Enhancement.cs): `XPoker/Enums/Enhancement.cs`

### Console interface

- [Score breakdown](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/UI/ScoreBreakdown.cs): `XPoker/UI/ScoreBreakdown.cs`
- [Console formatting](https://github.com/daniillishankov-alt/xpoker/blob/master/XPoker/UI/ConsoleHelper.cs): `XPoker/UI/ConsoleHelper.cs`

### Other components

- **Player**

## Connections

- Player → Game entry: starts game (evidence: `XPoker/Program.cs`)
- Game entry → Session state: creates session (evidence: `XPoker/Program.cs`)
- Game entry → Game controller: starts controller (evidence: `XPoker/Program.cs`)
- Game controller → Session state: updates state (evidence: `XPoker/ViewModel.cs`)
- Game controller → Deck and draws: draws cards (evidence: `XPoker/ViewModel.cs`)
- Game controller → Enhancement shop: requests items (evidence: `XPoker/ViewModel.cs`)
- Game controller → Hand evaluator: evaluates hand (evidence: `XPoker/ViewModel.cs`)
- Game controller → Score breakdown: builds breakdown (evidence: `XPoker/ViewModel.cs`)
- Deck and draws → Card types: deals cards (evidence: `XPoker/Deck.cs`)
- Hand evaluator → Hand rules: checks rules (evidence: `XPoker/HandEvaluator.cs`)
- Hand evaluator → Card types: reads cards (evidence: `XPoker/HandEvaluator.cs`)
- Enhancement shop → Enhancements: offers items (evidence: `XPoker/Shop.cs`)
- Session state → Enhancements: applies purchase (evidence: `XPoker/GameSession.cs`)
- Console formatting → Score breakdown: formats details (evidence: `XPoker/UI/ConsoleHelper.cs`)
