# jruss256/cs1720 architecture

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

- Interactive diagram: https://gitdiagram.com/jruss256/cs1720
- Repository: https://github.com/jruss256/cs1720

## Overview

Project.java is a console-based D&D choose-your-own-adventure game. The player selects a class, receives derived combat statistics, chooses a destination that determines the enemy, then repeatedly attacks or heals until either combatant falls. Random rolls resolve attacks, damage, and healing, after which the game prints victory or defeat. The repository contains only this monolithic runtime; the diagram therefore represents internal stages within Project.java rather than separate modules.

Main entry points: [`Project.java`](https://github.com/jruss256/cs1720/blob/main/Project.java) (Game Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Player Interaction"]
  node_main["Game Entry<br/>[Project.java]"]
  node_console["Console I/O"]
end

subgraph group_adventure["Adventure Setup"]
  node_class_selection["Class Selection<br/>[Project.java]"]
  node_encounter_setup["Encounter Setup<br/>[Project.java]"]
end

subgraph group_combat["Combat Runtime"]
  node_battle_loop["Battle Loop<br/>[Project.java]"]
  node_combat_resolution["Combat Resolution<br/>[Project.java]"]
  node_random_generator["Random Generator"]
  node_outcome["Outcome Display<br/>[Project.java]"]
end

node_player(("Player"))

node_player -->|"enters choices"| node_console
node_console -->|"provides input"| node_main
node_main -->|"prints prompts"| node_console
node_main -->|"handles class"| node_class_selection
node_main -->|"selects encounter"| node_encounter_setup
node_main -->|"runs battle"| node_battle_loop
node_battle_loop -->|"reads actions"| node_console
node_battle_loop -->|"resolves turns"| node_combat_resolution
node_battle_loop -->|"requests rolls"| node_random_generator
node_combat_resolution -->|"updates health"| node_battle_loop
node_main -->|"reports result"| node_outcome
node_outcome -->|"prints result"| node_console

click node_main "https://github.com/jruss256/cs1720/blob/main/Project.java"
click node_class_selection "https://github.com/jruss256/cs1720/blob/main/Project.java"
click node_encounter_setup "https://github.com/jruss256/cs1720/blob/main/Project.java"
click node_battle_loop "https://github.com/jruss256/cs1720/blob/main/Project.java"
click node_combat_resolution "https://github.com/jruss256/cs1720/blob/main/Project.java"
click node_outcome "https://github.com/jruss256/cs1720/blob/main/Project.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_console toneBlue
class node_class_selection,node_encounter_setup toneAmber
class node_battle_loop,node_combat_resolution,node_random_generator,node_outcome toneMint
class node_player toneIndigo
```

## Components

### Player Interaction

- [Game Entry](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`
- **Console I/O**

### Adventure Setup

- [Class Selection](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`
- [Encounter Setup](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`

### Combat Runtime

- [Battle Loop](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`
- [Combat Resolution](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`
- **Random Generator**
- [Outcome Display](https://github.com/jruss256/cs1720/blob/main/Project.java): `Project.java`

### Other components

- **Player**

## Connections

- Player → Console I/O: enters choices
- Console I/O → Game Entry: provides input
- Game Entry → Console I/O: prints prompts
- Game Entry → Class Selection: handles class
- Game Entry → Encounter Setup: selects encounter
- Game Entry → Battle Loop: runs battle
- Battle Loop → Console I/O: reads actions
- Battle Loop → Combat Resolution: resolves turns
- Battle Loop → Random Generator: requests rolls
- Combat Resolution → Battle Loop: updates health
- Game Entry → Outcome Display: reports result
- Outcome Display → Console I/O: prints result
