# iwanstahl/d7032e_homeexam architecture

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

- Interactive diagram: https://gitdiagram.com/iwanstahl/d7032e_homeexam
- Repository: https://github.com/iwanstahl/d7032e_homeexam

## Overview

This repository implements Exploding Kittens as a turn-based game with console, bot, and socket-based player interfaces. The principal workflow is to start a game, construct its players and card piles, run turns in which players play cards or draw, apply card effects and turn-order changes, then report events and determine elimination or victory. The graph preserves setup, card rules, shared game actions, state, and the documented I/O options. Edges are limited to relationships visible in excerpts or the source index; several peripheral implementations were not sampled.

Main entry points: [`isawan-3/src/main/java/game/setup/GameSetup.java`](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/GameSetup.java) (Game setup), [`isawan-3/src/main/java/game/turn/TurnManager.java`](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/TurnManager.java) (Turn manager), [`isawan-3/src/main/java/ExplodingKittens.java`](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/ExplodingKittens.java) (Game launcher), [`isawan-3/src/main/java/game/turn/GameActions.java`](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/GameActions.java) (Shared game actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Game entry"]
  node_launcher["Game launcher"]
end

subgraph group_setup["Game setup and state"]
  node_setupflow["Game setup<br/>[GameSetup.java]"]
  node_modules["Deck modules"]
  node_expansion["Expansion module"]
  node_gamestate["Game state<br/>[GameState.java]"]
  node_recipe["Deck recipe<br/>[DeckRecipe.java]"]
  node_player["Player and hand<br/>[Player.java]"]
  node_deck[("Draw deck<br/>[ListDeck.java]")]
  node_discard[("Discard pile<br/>[ListDiscard.java]")]
  node_random["Random source"]
end

subgraph group_rules["Turns and card rules"]
  node_turns["Turn manager<br/>[TurnManager.java]"]
  node_orchestrator["Game orchestrator"]
  node_actions["Shared game actions<br/>[GameActions.java]"]
  node_context["Turn context<br/>[TurnContext.java]"]
  node_cards["Card rules"]
  node_combos["Card combos"]
  node_nope["Nope window"]
end

subgraph group_interfaces["Player interfaces"]
  node_eventprompt["Events and prompts<br/>[GameEvent.java]"]
  node_console["Console player I/O"]
  node_bot["Bot player I/O<br/>[BotPlayerIO.java]"]
  node_server["Lobby server<br/>[LobbyServer.java]"]
  node_socketio["Socket player I/O"]
  node_client["Game client<br/>[GameClient.java]"]
end

node_participant(("Player"))

node_launcher -->|"starts setup"| node_setupflow
node_launcher -->|"configures"| node_console
node_launcher -->|"configures"| node_bot
node_launcher -->|"starts"| node_server
node_launcher -->|"starts"| node_client
node_setupflow -->|"uses"| node_modules
node_setupflow -->|"builds from"| node_recipe
node_setupflow -->|"creates"| node_gamestate
node_setupflow -->|"creates"| node_deck
node_setupflow -->|"creates"| node_discard
node_setupflow -->|"creates"| node_player
node_setupflow -->|"uses"| node_random
node_modules -->|"selects cards"| node_cards
node_modules -->|"supports"| node_expansion
node_launcher -->|"runs game"| node_orchestrator
node_orchestrator -->|"runs turns"| node_turns
node_turns -->|"broadcasts and targets"| node_actions
node_turns -->|"executes combos"| node_combos
node_turns -->|"resolves Nope"| node_nope
node_turns -->|"plays and draws"| node_cards
node_turns -->|"builds context"| node_context
node_turns -->|"draws from"| node_deck
node_turns -->|"discards to"| node_discard
node_context -->|"holds actor"| node_player
node_context -->|"provides access"| node_deck
node_context -->|"provides access"| node_discard
node_actions -->|"notifies"| node_player
node_actions -->|"sends events"| node_eventprompt
node_actions -->|"moves cards"| node_discard
node_participant -.->|"uses"| node_console
node_participant -.->|"uses"| node_client
node_client -->|"uses"| node_console
node_server -->|"creates"| node_socketio
node_console -->|"handles prompts and events"| node_eventprompt
node_bot -->|"handles prompts and events"| node_eventprompt
node_socketio -->|"handles prompts and events"| node_eventprompt

click node_launcher "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/ExplodingKittens.java"
click node_setupflow "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/GameSetup.java"
click node_modules "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/BaseGameModule.java"
click node_expansion "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/ExpansionModule.java"
click node_gamestate "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/GameState.java"
click node_recipe "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/DeckRecipe.java"
click node_turns "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/TurnManager.java"
click node_orchestrator "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/GameOrchestrator.java"
click node_actions "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/GameActions.java"
click node_context "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/TurnContext.java"
click node_cards "https://github.com/iwanstahl/d7032e_homeexam/tree/main/isawan-3/src/main/java/game/card"
click node_combos "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/CardComboAction.java"
click node_nope "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/NopeTimeWindow.java"
click node_player "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/player/Player.java"
click node_deck "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/deck/ListDeck.java"
click node_discard "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/deck/ListDiscard.java"
click node_random "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/random/DefaultRandomSource.java"
click node_eventprompt "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/io/GameEvent.java"
click node_console "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/console/ConsolePlayerIO.java"
click node_bot "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/bot/BotPlayerIO.java"
click node_server "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/LobbyServer.java"
click node_socketio "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/SocketPlayerIO.java"
click node_client "https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/GameClient.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_launcher toneBlue
class node_setupflow,node_modules,node_expansion,node_gamestate,node_recipe,node_player,node_deck,node_discard,node_random toneAmber
class node_turns,node_orchestrator,node_actions,node_context,node_cards,node_combos,node_nope toneMint
class node_eventprompt,node_console,node_bot,node_server,node_socketio,node_client toneRose
class node_participant toneIndigo
```

## Components

### Game entry

- [Game launcher](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/ExplodingKittens.java): `isawan-3/src/main/java/ExplodingKittens.java`

### Game setup and state

- [Game setup](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/GameSetup.java): `isawan-3/src/main/java/game/setup/GameSetup.java`
- [Deck modules](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/BaseGameModule.java): `isawan-3/src/main/java/game/setup/BaseGameModule.java`
- [Expansion module](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/ExpansionModule.java): `isawan-3/src/main/java/game/setup/ExpansionModule.java`
- [Game state](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/GameState.java): `isawan-3/src/main/java/game/setup/GameState.java`
- [Deck recipe](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/setup/DeckRecipe.java): `isawan-3/src/main/java/game/setup/DeckRecipe.java`
- [Player and hand](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/player/Player.java): `isawan-3/src/main/java/game/player/Player.java`
- [Draw deck](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/deck/ListDeck.java): `isawan-3/src/main/java/game/deck/ListDeck.java`
- [Discard pile](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/deck/ListDiscard.java): `isawan-3/src/main/java/game/deck/ListDiscard.java`
- [Random source](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/random/DefaultRandomSource.java): `isawan-3/src/main/java/game/random/DefaultRandomSource.java`

### Turns and card rules

- [Turn manager](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/TurnManager.java): `isawan-3/src/main/java/game/turn/TurnManager.java`
- [Game orchestrator](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/GameOrchestrator.java): `isawan-3/src/main/java/game/turn/GameOrchestrator.java`
- [Shared game actions](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/GameActions.java): `isawan-3/src/main/java/game/turn/GameActions.java`
- [Turn context](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/TurnContext.java): `isawan-3/src/main/java/game/turn/TurnContext.java`
- [Card rules](https://github.com/iwanstahl/d7032e_homeexam/tree/main/isawan-3/src/main/java/game/card): `isawan-3/src/main/java/game/card`
- [Card combos](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/CardComboAction.java): `isawan-3/src/main/java/game/turn/CardComboAction.java`
- [Nope window](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/turn/NopeTimeWindow.java): `isawan-3/src/main/java/game/turn/NopeTimeWindow.java`

### Player interfaces

- [Events and prompts](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/io/GameEvent.java): `isawan-3/src/main/java/game/io/GameEvent.java`
- [Console player I/O](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/console/ConsolePlayerIO.java): `isawan-3/src/main/java/game/console/ConsolePlayerIO.java`
- [Bot player I/O](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/bot/BotPlayerIO.java): `isawan-3/src/main/java/game/bot/BotPlayerIO.java`
- [Lobby server](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/LobbyServer.java): `isawan-3/src/main/java/game/net/LobbyServer.java`
- [Socket player I/O](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/SocketPlayerIO.java): `isawan-3/src/main/java/game/net/SocketPlayerIO.java`
- [Game client](https://github.com/iwanstahl/d7032e_homeexam/blob/main/isawan-3/src/main/java/game/net/GameClient.java): `isawan-3/src/main/java/game/net/GameClient.java`

### Other components

- **Player**

## Connections

- Game launcher → Game setup: starts setup (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game launcher → Console player I/O: configures (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game launcher → Bot player I/O: configures (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game launcher → Lobby server: starts (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game launcher → Game client: starts (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game setup → Deck modules: uses (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Deck recipe: builds from (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Game state: creates (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Draw deck: creates (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Discard pile: creates (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Player and hand: creates (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Game setup → Random source: uses (evidence: `isawan-3/src/main/java/game/setup/GameSetup.java`)
- Deck modules → Card rules: selects cards (evidence: `isawan-3/src/main/java/game/setup/BaseGameModule.java`)
- Deck modules → Expansion module: supports (evidence: `isawan-3/src/main/java/game/setup/BaseGameModule.java`)
- Game launcher → Game orchestrator: runs game (evidence: `isawan-3/src/main/java/ExplodingKittens.java`)
- Game orchestrator → Turn manager: runs turns (evidence: `isawan-3/src/main/java/game/turn/GameOrchestrator.java`)
- Turn manager → Shared game actions: broadcasts and targets (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Card combos: executes combos (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Nope window: resolves Nope (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Card rules: plays and draws (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Turn context: builds context (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Draw deck: draws from (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn manager → Discard pile: discards to (evidence: `isawan-3/src/main/java/game/turn/TurnManager.java`)
- Turn context → Player and hand: holds actor (evidence: `isawan-3/src/main/java/game/turn/TurnContext.java`)
- Turn context → Draw deck: provides access (evidence: `isawan-3/src/main/java/game/turn/TurnContext.java`)
- Turn context → Discard pile: provides access (evidence: `isawan-3/src/main/java/game/turn/TurnContext.java`)
- Shared game actions → Player and hand: notifies (evidence: `isawan-3/src/main/java/game/turn/GameActions.java`)
- Shared game actions → Events and prompts: sends events (evidence: `isawan-3/src/main/java/game/turn/GameActions.java`)
- Shared game actions → Discard pile: moves cards (evidence: `isawan-3/src/main/java/game/turn/GameActions.java`)
- Player → Console player I/O: uses
- Player → Game client: uses
- Game client → Console player I/O: uses (evidence: `isawan-3/src/main/java/game/net/GameClient.java`)
- Lobby server → Socket player I/O: creates (evidence: `isawan-3/src/main/java/game/net/LobbyServer.java`)
- Console player I/O → Events and prompts: handles prompts and events (evidence: `isawan-3/src/main/java/game/console/ConsolePlayerIO.java`)
- Bot player I/O → Events and prompts: handles prompts and events (evidence: `isawan-3/src/main/java/game/bot/BotPlayerIO.java`)
- Socket player I/O → Events and prompts: handles prompts and events (evidence: `isawan-3/src/main/java/game/net/SocketPlayerIO.java`)
