# hugo-grandia-my-guy/balaltrofirst architecture

> Architecture diagram of the GitHub repository hugo-grandia-my-guy/balaltrofirst, 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/hugo-grandia-my-guy/balaltrofirst
- Repository: https://github.com/hugo-grandia-my-guy/balaltrofirst

## Overview

Mini Balatro is a console poker-hand scoring game. The player selects cards to play or discard; the game draws replacements, evaluates played hands, applies card and hand multipliers, updates the round score, and proceeds to another round when the target is reached. The graph separates gameplay orchestration, card/deck state, hand evaluation, and console presentation. Evidence is limited to the supplied excerpts and source index; some model details are represented by their exact enclosing directory where their behavior was not sampled.

Main entry points: [`ConsoleApp1/Game.cs`](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Game.cs) (Game loop), [`ConsoleApp1/models/Deck.cs`](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Deck.cs) (Deck), [`ConsoleApp1/models/PokerHandEvaluator.cs`](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/PokerHandEvaluator.cs) (Hand evaluator), [`ConsoleApp1/Program.cs`](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Program.cs) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Gameplay"]
  node_entry["Program entry<br/>[Program.cs]"]
  node_game["Game loop<br/>[Game.cs]"]
  node_round["Round state<br/>[Rounds.cs]"]
end

subgraph group_cards["Cards"]
  node_deck["Deck<br/>[Deck.cs]"]
  node_card["Card model<br/>[Card.cs]"]
  node_specials["Special cards"]
  node_rank_suit["Rank and suit<br/>[Value.cs]"]
end

subgraph group_evaluation["Hand evaluation"]
  node_evaluator["Hand evaluator"]
  node_hand_rules["Poker hand rules"]
  node_hand_result["Hand result"]
end

subgraph group_presentation["Console UI"]
  node_viewmodel["Round view model<br/>[RoundViewModel.cs]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_entry
node_entry -->|"creates game"| node_game
node_player -->|"selects actions"| node_game
node_game -->|"draws cards"| node_deck
node_deck -->|"creates and draws"| node_card
node_deck -->|"creates variants"| node_specials
node_card -->|"uses rank and suit"| node_rank_suit
node_game -->|"evaluates played hand"| node_evaluator
node_evaluator -->|"dispatches match checks"| node_hand_rules
node_evaluator -->|"returns hand result"| node_hand_result
node_game -->|"applies card bonuses"| node_specials
node_game -->|"updates round state"| node_round
node_game -->|"refreshes display data"| node_viewmodel
node_viewmodel -->|"reads round state"| node_round

click node_entry "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Program.cs"
click node_game "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Game.cs"
click node_round "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Rounds.cs"
click node_deck "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Deck.cs"
click node_card "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Card.cs"
click node_specials "https://github.com/hugo-grandia-my-guy/balaltrofirst/tree/master/ConsoleApp1/models"
click node_rank_suit "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Value.cs"
click node_evaluator "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/PokerHandEvaluator.cs"
click node_hand_rules "https://github.com/hugo-grandia-my-guy/balaltrofirst/tree/master/ConsoleApp1/models/PokerHands"
click node_hand_result "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/PokerHandEvaluator.cs"
click node_viewmodel "https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/ViewModels/RoundViewModel.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_entry,node_game,node_round toneBlue
class node_deck,node_card,node_specials,node_rank_suit toneAmber
class node_evaluator,node_hand_rules,node_hand_result toneMint
class node_viewmodel toneRose
class node_player toneIndigo
```

## Components

### Gameplay

- [Program entry](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Program.cs): `ConsoleApp1/Program.cs`
- [Game loop](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/Game.cs): `ConsoleApp1/Game.cs`
- [Round state](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Rounds.cs): `ConsoleApp1/models/Rounds.cs`

### Cards

- [Deck](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Deck.cs): `ConsoleApp1/models/Deck.cs`
- [Card model](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Card.cs): `ConsoleApp1/models/Card.cs`
- [Special cards](https://github.com/hugo-grandia-my-guy/balaltrofirst/tree/master/ConsoleApp1/models): `ConsoleApp1/models`
- [Rank and suit](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/Value.cs): `ConsoleApp1/models/Value.cs`

### Hand evaluation

- [Hand evaluator](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/PokerHandEvaluator.cs): `ConsoleApp1/models/PokerHandEvaluator.cs`
- [Poker hand rules](https://github.com/hugo-grandia-my-guy/balaltrofirst/tree/master/ConsoleApp1/models/PokerHands): `ConsoleApp1/models/PokerHands`
- [Hand result](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/models/PokerHandEvaluator.cs): `ConsoleApp1/models/PokerHandEvaluator.cs`

### Console UI

- [Round view model](https://github.com/hugo-grandia-my-guy/balaltrofirst/blob/master/ConsoleApp1/ViewModels/RoundViewModel.cs): `ConsoleApp1/ViewModels/RoundViewModel.cs`

### Other components

- **Player**

## Connections

- Player → Program entry: starts game (evidence: `ConsoleApp1/Program.cs`)
- Program entry → Game loop: creates game (evidence: `ConsoleApp1/Program.cs`)
- Player → Game loop: selects actions (evidence: `ConsoleApp1/Game.cs`)
- Game loop → Deck: draws cards (evidence: `ConsoleApp1/Game.cs`)
- Deck → Card model: creates and draws (evidence: `ConsoleApp1/models/Deck.cs`)
- Deck → Special cards: creates variants (evidence: `ConsoleApp1/models/Deck.cs`)
- Card model → Rank and suit: uses rank and suit (evidence: `ConsoleApp1/models/Card.cs`)
- Game loop → Hand evaluator: evaluates played hand (evidence: `ConsoleApp1/Game.cs`)
- Hand evaluator → Poker hand rules: dispatches match checks (evidence: `ConsoleApp1/models/PokerHandEvaluator.cs`)
- Hand evaluator → Hand result: returns hand result (evidence: `ConsoleApp1/models/PokerHandEvaluator.cs`)
- Game loop → Special cards: applies card bonuses (evidence: `ConsoleApp1/Game.cs`)
- Game loop → Round state: updates round state (evidence: `ConsoleApp1/Game.cs`)
- Game loop → Round view model: refreshes display data (evidence: `ConsoleApp1/Game.cs`)
- Round view model → Round state: reads round state (evidence: `ConsoleApp1/ViewModels/RoundViewModel.cs`)
