# stuff1do/canyousurviveanaiapocalypse- architecture

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

- Interactive diagram: https://gitdiagram.com/stuff1do/canyousurviveanaiapocalypse-
- Repository: https://github.com/stuff1do/canyousurviveanaiapocalypse-

## Overview

This is a Java Swing quiz game about surviving an AI apocalypse, with a separate command-line mode. Players enter through the splash/menu flow, select a host, answer questions that advance through difficulty tiers, use lifelines, and reach withdrawal, checkpoint, game-over, or victory outcomes. `QuestionLoader` parses the bundled question bank, while `StateManager` tracks the playthrough. The tree and excerpts establish the main GUI wiring and some gameplay behavior; several screen and terminal implementations were not sampled, so their internal transitions are not detailed here.

Main entry points: [`src/main/java/com/cysaaa/App.java`](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/App.java) (App entry), [`src/main/java/com/cysaaa/gui/screens/GameplayPanel.java`](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/GameplayPanel.java) (Gameplay), [`src/main/java/com/cysaaa/gui/screens/ProgressPanel.java`](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/ProgressPanel.java) (Progress screen), [`src/main/java/com/cysaaa/util/QuestionLoader.java`](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/QuestionLoader.java) (Question loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and modes"]
  node_app["App entry<br/>[App.java]"]
  node_terminal["Terminal mode<br/>[TApp.java]"]
end

subgraph group_game["Game experience"]
  node_splash["Splash screen"]
  node_menu["Main menu<br/>[MainMenuPanel.java]"]
  node_instructions["Instructions"]
  node_host["Host selection"]
  node_gameplay["Gameplay<br/>[GameplayPanel.java]"]
  node_progress["Progress screen<br/>[ProgressPanel.java]"]
  node_gameover["Game over<br/>[GameOverPanel.java]"]
  node_checkpoint["Checkpoint endings"]
  node_synthetic["Synthetic ending"]
  node_victory["Victory ending<br/>[VictoryScreen.java]"]
  node_uiwidgets["UI components<br/>[ImagePanel.java]"]
end

subgraph group_domain["Questions and state"]
  node_loader["Question loader"]
  node_question["Question model<br/>[Question.java]"]
  node_state["Game state<br/>[StateManager.java]"]
  node_lifeline["Lifeline definitions<br/>[Lifeline.java]"]
end

subgraph group_resources["Game resources"]
  node_questionbank["Question bank<br/>[questions.csv]"]
end

node_player(("Player"))

node_player -->|"starts"| node_app
node_app -.->|"runs with arguments"| node_terminal
node_app -->|"loads questions"| node_loader
node_loader -->|"reads CSV"| node_questionbank
node_loader -->|"creates questions"| node_question
node_app -->|"constructs screen"| node_splash
node_app -->|"constructs screen"| node_menu
node_app -->|"constructs screen"| node_instructions
node_app -->|"constructs screen"| node_host
node_app -->|"constructs screen"| node_gameplay
node_app -->|"constructs screen"| node_progress
node_app -->|"constructs screen"| node_gameover
node_app -->|"constructs screen"| node_checkpoint
node_app -->|"constructs screen"| node_synthetic
node_app -->|"constructs screen"| node_victory
node_player -->|"views and interacts"| node_splash
node_player -.->|"uses CLI"| node_terminal
node_host -->|"selects host"| node_progress
node_progress -->|"continues play"| node_gameplay
node_gameplay -->|"reads and updates"| node_state
node_gameplay -->|"uses definitions"| node_lifeline
node_gameplay -->|"ends play"| node_gameover
node_gameplay -->|"reaches checkpoint"| node_checkpoint
node_gameplay -->|"reaches ending"| node_synthetic
node_gameplay -->|"wins game"| node_victory
node_splash -->|"uses components"| node_uiwidgets
node_progress -->|"uses components"| node_uiwidgets

click node_app "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/App.java"
click node_terminal "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/terminal/TApp.java"
click node_splash "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/SplashScreenPanel.java"
click node_menu "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/MainMenuPanel.java"
click node_instructions "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/InstructionsPanel.java"
click node_host "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/HostSelectionPanel.java"
click node_gameplay "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/GameplayPanel.java"
click node_progress "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/ProgressPanel.java"
click node_gameover "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/GameOverPanel.java"
click node_checkpoint "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/CyberneticScreen.java"
click node_synthetic "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/SyntheticScreen.java"
click node_victory "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/VictoryScreen.java"
click node_loader "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/QuestionLoader.java"
click node_question "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/Question.java"
click node_state "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/StateManager.java"
click node_lifeline "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/Lifeline.java"
click node_questionbank "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/resources/data/questions.csv"
click node_uiwidgets "https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/components/ImagePanel.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_app,node_terminal toneBlue
class node_splash,node_menu,node_instructions,node_host,node_gameplay,node_progress,node_gameover,node_checkpoint,node_synthetic,node_victory,node_uiwidgets toneAmber
class node_loader,node_question,node_state,node_lifeline toneMint
class node_questionbank toneRose
class node_player toneIndigo
```

## Components

### Entry and modes

- [App entry](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/App.java): `src/main/java/com/cysaaa/App.java`
- [Terminal mode](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/terminal/TApp.java): `src/main/java/com/cysaaa/terminal/TApp.java`

### Game experience

- [Splash screen](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/SplashScreenPanel.java): `src/main/java/com/cysaaa/gui/screens/SplashScreenPanel.java`
- [Main menu](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/MainMenuPanel.java): `src/main/java/com/cysaaa/gui/screens/MainMenuPanel.java`
- [Instructions](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/InstructionsPanel.java): `src/main/java/com/cysaaa/gui/screens/InstructionsPanel.java`
- [Host selection](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/HostSelectionPanel.java): `src/main/java/com/cysaaa/gui/screens/HostSelectionPanel.java`
- [Gameplay](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/GameplayPanel.java): `src/main/java/com/cysaaa/gui/screens/GameplayPanel.java`
- [Progress screen](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/ProgressPanel.java): `src/main/java/com/cysaaa/gui/screens/ProgressPanel.java`
- [Game over](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/GameOverPanel.java): `src/main/java/com/cysaaa/gui/screens/GameOverPanel.java`
- [Checkpoint endings](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/CyberneticScreen.java): `src/main/java/com/cysaaa/gui/screens/CyberneticScreen.java`
- [Synthetic ending](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/SyntheticScreen.java): `src/main/java/com/cysaaa/gui/screens/SyntheticScreen.java`
- [Victory ending](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/screens/VictoryScreen.java): `src/main/java/com/cysaaa/gui/screens/VictoryScreen.java`
- [UI components](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/gui/components/ImagePanel.java): `src/main/java/com/cysaaa/gui/components/ImagePanel.java`

### Questions and state

- [Question loader](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/QuestionLoader.java): `src/main/java/com/cysaaa/util/QuestionLoader.java`
- [Question model](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/Question.java): `src/main/java/com/cysaaa/util/Question.java`
- [Game state](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/StateManager.java): `src/main/java/com/cysaaa/util/StateManager.java`
- [Lifeline definitions](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/java/com/cysaaa/util/Lifeline.java): `src/main/java/com/cysaaa/util/Lifeline.java`

### Game resources

- [Question bank](https://github.com/stuff1do/canyousurviveanaiapocalypse-/blob/main/src/main/resources/data/questions.csv): `src/main/resources/data/questions.csv`

### Other components

- **Player**

## Connections

- Player → App entry: starts
- App entry → Terminal mode: runs with arguments
- App entry → Question loader: loads questions
- Question loader → Question bank: reads CSV
- Question loader → Question model: creates questions
- App entry → Splash screen: constructs screen
- App entry → Main menu: constructs screen
- App entry → Instructions: constructs screen
- App entry → Host selection: constructs screen
- App entry → Gameplay: constructs screen
- App entry → Progress screen: constructs screen
- App entry → Game over: constructs screen
- App entry → Checkpoint endings: constructs screen
- App entry → Synthetic ending: constructs screen
- App entry → Victory ending: constructs screen
- Player → Splash screen: views and interacts
- Player → Terminal mode: uses CLI
- Host selection → Progress screen: selects host
- Progress screen → Gameplay: continues play
- Gameplay → Game state: reads and updates
- Gameplay → Lifeline definitions: uses definitions
- Gameplay → Game over: ends play
- Gameplay → Checkpoint endings: reaches checkpoint
- Gameplay → Synthetic ending: reaches ending
- Gameplay → Victory ending: wins game
- Splash screen → UI components: uses components
- Progress screen → UI components: uses components
