# giuliasme/boardgame_engine architecture

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

- Interactive diagram: https://gitdiagram.com/giuliasme/boardgame_engine
- Repository: https://github.com/giuliasme/boardgame_engine

## Overview

This is an early, terminal-based dots-and-boxes game, not yet the configurable multi-game engine described as the project’s goal. The current workflow creates a board and one player, displays the board, reads a wall selection, and asks the board to update it until the user exits. Board logic handles wall placement and awards points when a cell is completed. The README lists turn control, win/draw conditions, and JSON-driven games as planned capabilities; the supplied source does not implement them. Evidence is limited to the README and the excerpts shown.

Main entry points: [`src/Main.java`](https://github.com/giuliasme/boardgame_engine/blob/main/src/Main.java) (Game startup loop), [`src/UiManager.java`](https://github.com/giuliasme/boardgame_engine/blob/main/src/UiManager.java) (Move input and display), [`src/Board.java`](https://github.com/giuliasme/boardgame_engine/blob/main/src/Board.java) (Board and wall logic), [`src/Player.java`](https://github.com/giuliasme/boardgame_engine/blob/main/src/Player.java) (Player and points)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and terminal UI"]
  node_main["Game startup loop<br/>[Main.java]"]
  node_ui["Move input and display<br/>[UiManager.java]"]
end

subgraph group_game["Game state and rules"]
  node_board["Board and wall logic<br/>[Board.java]"]
  node_player["Player and points<br/>[Player.java]"]
  node_game_manager["Game manager<br/>[GameManager.java]"]
  node_rules["Rules placeholder<br/>[Rules.java]"]
end

node_terminal_user(("Terminal user"))

node_terminal_user -->|"starts game"| node_main
node_main -->|"calls menu"| node_ui
node_main -->|"creates board"| node_board
node_main -->|"creates player"| node_player
node_ui -->|"reads input"| node_terminal_user
node_ui -->|"displays and updates"| node_board
node_board -->|"awards points"| node_player

click node_main "https://github.com/giuliasme/boardgame_engine/blob/main/src/Main.java"
click node_ui "https://github.com/giuliasme/boardgame_engine/blob/main/src/UiManager.java"
click node_board "https://github.com/giuliasme/boardgame_engine/blob/main/src/Board.java"
click node_player "https://github.com/giuliasme/boardgame_engine/blob/main/src/Player.java"
click node_game_manager "https://github.com/giuliasme/boardgame_engine/blob/main/src/GameManager.java"
click node_rules "https://github.com/giuliasme/boardgame_engine/blob/main/src/Rules.java"

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_main,node_ui,node_terminal_user toneBlue
class node_board,node_player,node_game_manager,node_rules toneAmber
```

## Components

### Entry and terminal UI

- [Game startup loop](https://github.com/giuliasme/boardgame_engine/blob/main/src/Main.java): `src/Main.java`
- [Move input and display](https://github.com/giuliasme/boardgame_engine/blob/main/src/UiManager.java): `src/UiManager.java`

### Game state and rules

- [Board and wall logic](https://github.com/giuliasme/boardgame_engine/blob/main/src/Board.java): `src/Board.java`
- [Player and points](https://github.com/giuliasme/boardgame_engine/blob/main/src/Player.java): `src/Player.java`
- [Game manager](https://github.com/giuliasme/boardgame_engine/blob/main/src/GameManager.java): `src/GameManager.java`
- [Rules placeholder](https://github.com/giuliasme/boardgame_engine/blob/main/src/Rules.java): `src/Rules.java`

### Other components

- **Terminal user**

## Connections

- Terminal user → Game startup loop: starts game (evidence: `README.md`)
- Game startup loop → Move input and display: calls menu (evidence: `src/Main.java`)
- Game startup loop → Board and wall logic: creates board (evidence: `src/Main.java`)
- Game startup loop → Player and points: creates player (evidence: `src/Main.java`)
- Move input and display → Terminal user: reads input (evidence: `src/UiManager.java`)
- Move input and display → Board and wall logic: displays and updates (evidence: `src/UiManager.java`)
- Board and wall logic → Player and points: awards points (evidence: `src/Board.java`)
