# maverick001/ifn584_assignment3 architecture

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

- Interactive diagram: https://gitdiagram.com/maverick001/ifn584_assignment3
- Repository: https://github.com/maverick001/ifn584_assignment3

## Overview

This is a shared board-game framework with Gomoku and Reversi variants, driven through an interactive menu or scripted CLI. The workflow selects a catalog factory, creates a configured game, then the core loop parses and validates turns, applies reversible commands, checks outcomes, and renders updates. The README also describes save/load replay, variant-specific rules and views, and AI, though several are placeholders or unsampled. Edges follow excerpts or README statements; unsampled capability wiring is not asserted.

Main entry points: [`src/BoardGames.Core/Game.cs`](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Game.cs) (Game loop), [`src/BoardGames.Core/Factories.cs`](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Factories.cs) (Factory catalog), [`src/BoardGames.App/Program.cs`](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/Program.cs) (Program entry), [`src/BoardGames.App/MainMenu.cs`](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/MainMenu.cs) (Interactive menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application entry"]
  node_program["Program entry<br/>[Program.cs]"]
  node_menu["Interactive menu<br/>[MainMenu.cs]"]
  node_cli["Scripted CLI<br/>[CliRunner.cs]"]
end

subgraph group_catalog["Game catalog"]
  node_setup["Catalog setup<br/>[CatalogSetup.cs]"]
  node_catalog_runtime["Factory catalog<br/>[Factories.cs]"]
end

subgraph group_core["Shared game runtime"]
  node_game_loop["Game loop<br/>[Game.cs]"]
  node_input["Input parsing<br/>[Input.cs]"]
  node_game_io["Game I/O<br/>[GameIO.cs]"]
  node_board["Board state<br/>[Board.cs]"]
  node_commands["Move history<br/>[Commands.cs]"]
  node_strategies["Win and AI strategies<br/>[Strategies.cs]"]
  node_views["Board and help views<br/>[Views.cs]"]
  node_persistence[("Save repository<br/>[Persistence.cs]")]
end

subgraph group_gomoku["Gomoku variants"]
  node_gomoku_factory["Gomoku factories<br/>[GomokuFactories.cs]"]
  node_gomoku_game["Gomoku rules<br/>[GomokuGame.cs]"]
end

subgraph group_reversi["Reversi variants"]
  node_reversi_factory["Reversi factories"]
  node_reversi_game["Reversi rules<br/>[ReversiGame.cs]"]
end

node_player(("Player"))
node_save_file["Save file"]

node_player -.->|"starts"| node_program
node_program -->|"builds catalog"| node_setup
node_program -->|"dispatches"| node_cli
node_program -->|"starts"| node_menu
node_setup -->|"registers factories"| node_catalog_runtime
node_menu -->|"chooses or resolves"| node_catalog_runtime
node_cli -->|"resolves variant"| node_catalog_runtime
node_catalog_runtime -.->|"registers variants"| node_gomoku_factory
node_catalog_runtime -.->|"registers variants"| node_reversi_factory
node_gomoku_factory -->|"assembles"| node_gomoku_game
node_reversi_factory -->|"assembles"| node_reversi_game
node_gomoku_game -->|"inherits loop"| node_game_loop
node_reversi_game -->|"inherits loop"| node_game_loop
node_menu -->|"plays game"| node_game_loop
node_cli -->|"plays script"| node_game_loop
node_game_loop -->|"parses input"| node_input
node_game_loop -->|"reads and writes"| node_game_io
node_game_loop -->|"records moves"| node_commands
node_commands -->|"applies changes"| node_board
node_game_loop -->|"checks state"| node_board
node_game_loop -.->|"evaluates result"| node_strategies
node_game_loop -->|"notifies and redraws"| node_views
node_game_loop -->|"saves game"| node_persistence
node_menu -->|"loads game"| node_persistence
node_persistence -.->|"reads or writes"| node_save_file
node_gomoku_factory -.->|"configures rules and AI"| node_strategies
node_gomoku_factory -.->|"configures view and help"| node_views
node_reversi_factory -.->|"configures rules and AI"| node_strategies
node_reversi_factory -.->|"configures help"| node_views

click node_program "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/Program.cs"
click node_menu "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/MainMenu.cs"
click node_cli "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/CliRunner.cs"
click node_setup "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/CatalogSetup.cs"
click node_catalog_runtime "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Factories.cs"
click node_gomoku_factory "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Gomoku/GomokuFactories.cs"
click node_gomoku_game "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Gomoku/GomokuGame.cs"
click node_reversi_factory "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Reversi/ReversiFactories.cs"
click node_reversi_game "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Reversi/ReversiGame.cs"
click node_game_loop "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Game.cs"
click node_input "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Input.cs"
click node_game_io "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/GameIO.cs"
click node_board "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Board.cs"
click node_commands "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Commands.cs"
click node_strategies "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Strategies.cs"
click node_views "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Views.cs"
click node_persistence "https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Persistence.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_menu,node_cli toneBlue
class node_setup,node_catalog_runtime toneAmber
class node_game_loop,node_input,node_game_io,node_board,node_commands,node_strategies,node_views,node_persistence toneMint
class node_gomoku_factory,node_gomoku_game toneRose
class node_reversi_factory,node_reversi_game,node_player,node_save_file toneIndigo
```

## Components

### Application entry

- [Program entry](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/Program.cs): `src/BoardGames.App/Program.cs`
- [Interactive menu](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/MainMenu.cs): `src/BoardGames.App/MainMenu.cs`
- [Scripted CLI](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/CliRunner.cs): `src/BoardGames.App/CliRunner.cs`

### Game catalog

- [Catalog setup](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.App/CatalogSetup.cs): `src/BoardGames.App/CatalogSetup.cs`
- [Factory catalog](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Factories.cs): `src/BoardGames.Core/Factories.cs`

### Shared game runtime

- [Game loop](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Game.cs): `src/BoardGames.Core/Game.cs`
- [Input parsing](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Input.cs): `src/BoardGames.Core/Input.cs`
- [Game I/O](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/GameIO.cs): `src/BoardGames.Core/GameIO.cs`
- [Board state](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Board.cs): `src/BoardGames.Core/Board.cs`
- [Move history](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Commands.cs): `src/BoardGames.Core/Commands.cs`
- [Win and AI strategies](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Strategies.cs): `src/BoardGames.Core/Strategies.cs`
- [Board and help views](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Views.cs): `src/BoardGames.Core/Views.cs`
- [Save repository](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Core/Persistence.cs): `src/BoardGames.Core/Persistence.cs`

### Gomoku variants

- [Gomoku factories](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Gomoku/GomokuFactories.cs): `src/BoardGames.Gomoku/GomokuFactories.cs`
- [Gomoku rules](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Gomoku/GomokuGame.cs): `src/BoardGames.Gomoku/GomokuGame.cs`

### Reversi variants

- [Reversi factories](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Reversi/ReversiFactories.cs): `src/BoardGames.Reversi/ReversiFactories.cs`
- [Reversi rules](https://github.com/maverick001/ifn584_assignment3/blob/main/src/BoardGames.Reversi/ReversiGame.cs): `src/BoardGames.Reversi/ReversiGame.cs`

### Other components

- **Player**
- **Save file**

## Connections

- Player → Program entry: starts
- Program entry → Catalog setup: builds catalog (evidence: `src/BoardGames.App/Program.cs`)
- Program entry → Scripted CLI: dispatches (evidence: `src/BoardGames.App/Program.cs`)
- Program entry → Interactive menu: starts (evidence: `src/BoardGames.App/Program.cs`)
- Catalog setup → Factory catalog: registers factories (evidence: `src/BoardGames.App/CatalogSetup.cs`)
- Interactive menu → Factory catalog: chooses or resolves (evidence: `src/BoardGames.App/MainMenu.cs`)
- Scripted CLI → Factory catalog: resolves variant (evidence: `src/BoardGames.App/CliRunner.cs`)
- Factory catalog → Gomoku factories: registers variants (evidence: `Readme.md`)
- Factory catalog → Reversi factories: registers variants (evidence: `Readme.md`)
- Gomoku factories → Gomoku rules: assembles (evidence: `src/BoardGames.Gomoku/GomokuFactories.cs`)
- Reversi factories → Reversi rules: assembles (evidence: `src/BoardGames.Reversi/ReversiFactories.cs`)
- Gomoku rules → Game loop: inherits loop (evidence: `src/BoardGames.Gomoku/GomokuGame.cs`)
- Reversi rules → Game loop: inherits loop (evidence: `src/BoardGames.Reversi/ReversiGame.cs`)
- Interactive menu → Game loop: plays game (evidence: `src/BoardGames.App/MainMenu.cs`)
- Scripted CLI → Game loop: plays script (evidence: `src/BoardGames.App/CliRunner.cs`)
- Game loop → Input parsing: parses input (evidence: `Readme.md`)
- Game loop → Game I/O: reads and writes (evidence: `src/BoardGames.Core/Game.cs`)
- Game loop → Move history: records moves (evidence: `src/BoardGames.Core/Game.cs`)
- Move history → Board state: applies changes (evidence: `src/BoardGames.Core/Commands.cs`)
- Game loop → Board state: checks state (evidence: `src/BoardGames.Core/Game.cs`)
- Game loop → Win and AI strategies: evaluates result
- Game loop → Board and help views: notifies and redraws (evidence: `Readme.md`)
- Game loop → Save repository: saves game (evidence: `src/BoardGames.Core/Game.cs`)
- Interactive menu → Save repository: loads game (evidence: `src/BoardGames.App/MainMenu.cs`)
- Save repository → Save file: reads or writes
- Gomoku factories → Win and AI strategies: configures rules and AI (evidence: `Readme.md`)
- Gomoku factories → Board and help views: configures view and help (evidence: `Readme.md`)
- Reversi factories → Win and AI strategies: configures rules and AI (evidence: `Readme.md`)
- Reversi factories → Board and help views: configures help (evidence: `Readme.md`)
