# theo-retical808/corpo_chaos architecture

> Architecture diagram of the GitHub repository theo-retical808/corpo_chaos, 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/theo-retical808/corpo_chaos
- Repository: https://github.com/theo-retical808/corpo_chaos

## Overview

Corporate Chaos is an offline WPF business-management simulation played quarter by quarter. The player starts or loads a run, manages company and employee decisions, resolves financial and chaos outcomes, and advances through the game; story mode adds guided dialogue, branching relationships, and endings. MainWindow is the central runtime coordinator. The graph includes the documented management and reporting capabilities plus the story systems identified in the source index. Unsampled feature links are omitted or marked unverified rather than presented as inspected calls.

Main entry points: [`corporate_chaos/MainWindow.xaml.cs`](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/MainWindow.xaml.cs) (Game Window), [`corporate_chaos/systems/NarrativeEngine.cs`](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/NarrativeEngine.cs) (Narrative Engine), [`corporate_chaos/systems/StoryModeManager.cs`](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryModeManager.cs) (Story Manager), [`corporate_chaos/systems/SaveLoadManager.cs`](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/SaveLoadManager.cs) (Save Manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_main["Game Window<br/>[MainWindow.xaml.cs]"]
end

subgraph group_business["Company Management"]
  node_employee["Employees<br/>[Employee.cs]"]
  node_company["Company State<br/>[company.cs]"]
  node_decisions["Executive Decisions<br/>[DecisionSystem.cs]"]
  node_chaos["Chaos Engine<br/>[ChaosEngine.cs]"]
  node_departments["Department Panel"]
  node_execui["Decision Panel"]
  node_financials["Financial Report"]
  node_quarter["Quarterly Summary"]
end

subgraph group_story["Story Mode"]
  node_storymanager["Story Manager"]
  node_narrative["Narrative Engine<br/>[NarrativeEngine.cs]"]
  node_characters["Character Manager"]
  node_branching["Story Branching"]
  node_beats["Emotional Beats"]
  node_endings["Ending Tracker"]
  node_advice["Character Advice"]
  node_dialogue["Character Dialogue"]
  node_content["Story Content"]
  node_storyview["Joan Dialogue"]
end

subgraph group_persistence["Local Game Data"]
  node_save["Save Manager<br/>[SaveLoadManager.cs]"]
  node_savedata["Save Records<br/>[GameSave.cs]"]
  node_data["Game Data<br/>[DataManager.cs]"]
  node_scores["High Scores<br/>[GameScore.cs]"]
  node_saveui["Save Browser"]
end

node_player(("Player"))

node_player -->|"plays"| node_main
node_main -->|"runs events"| node_chaos
node_main -->|"uses decisions"| node_decisions
node_main -->|"loads and saves"| node_save
node_main -->|"coordinates story"| node_storymanager
node_main -->|"uses data"| node_data
node_main -.->|"shows summary"| node_quarter
node_main -.->|"offers management"| node_departments
node_main -.->|"offers decisions"| node_execui
node_main -.->|"shows financials"| node_financials
node_main -->|"tracks employees"| node_employee
node_main -->|"records scores"| node_scores
node_storymanager -->|"manages characters"| node_characters
node_storymanager -->|"uses narrative"| node_narrative
node_narrative -->|"uses characters"| node_characters
node_narrative -->|"uses branching"| node_branching
node_narrative -->|"uses pacing"| node_beats
node_narrative -->|"uses content"| node_content
node_narrative -->|"uses advice"| node_advice
node_narrative -->|"tracks endings"| node_endings
node_narrative -->|"gets dialogue"| node_dialogue
node_storyview -->|"uses story mode"| node_storymanager
node_save -->|"serializes saves"| node_savedata
node_saveui -->|"browses saves"| node_save
node_data -->|"uses score data"| node_scores

click node_main "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/MainWindow.xaml.cs"
click node_employee "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/Employee.cs"
click node_company "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/company.cs"
click node_decisions "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/DecisionSystem.cs"
click node_chaos "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/ChaosEngine.cs"
click node_departments "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/DepartmentPanel.xaml.cs"
click node_execui "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/ExecutiveDecisions.xaml.cs"
click node_financials "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/FinancialReport.xaml.cs"
click node_quarter "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/QuarterlySummary.xaml.cs"
click node_storymanager "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryModeManager.cs"
click node_narrative "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/NarrativeEngine.cs"
click node_characters "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterManager.cs"
click node_branching "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryBranchingSystem.cs"
click node_beats "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/EmotionalBeatManager.cs"
click node_endings "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/EndingProbabilityTracker.cs"
click node_advice "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterAdviceSystem.cs"
click node_dialogue "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterDialogue.cs"
click node_content "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryContentDistributor.cs"
click node_storyview "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/JoanDialogue.xaml.cs"
click node_save "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/SaveLoadManager.cs"
click node_savedata "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/GameSave.cs"
click node_data "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/DataManager.cs"
click node_scores "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/GameScore.cs"
click node_saveui "https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/SaveFileManager.xaml.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_main toneBlue
class node_employee,node_company,node_decisions,node_chaos,node_departments,node_execui,node_financials,node_quarter toneAmber
class node_storymanager,node_narrative,node_characters,node_branching,node_beats,node_endings,node_advice,node_dialogue,node_content,node_storyview toneMint
class node_save,node_savedata,node_data,node_scores,node_saveui toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Window](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/MainWindow.xaml.cs): `corporate_chaos/MainWindow.xaml.cs`

### Company Management

- [Employees](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/Employee.cs): `corporate_chaos/models/Employee.cs`
- [Company State](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/company.cs): `corporate_chaos/models/company.cs`
- [Executive Decisions](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/DecisionSystem.cs): `corporate_chaos/systems/DecisionSystem.cs`
- [Chaos Engine](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/ChaosEngine.cs): `corporate_chaos/systems/ChaosEngine.cs`
- [Department Panel](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/DepartmentPanel.xaml.cs): `corporate_chaos/views/DepartmentPanel.xaml.cs`
- [Decision Panel](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/ExecutiveDecisions.xaml.cs): `corporate_chaos/views/ExecutiveDecisions.xaml.cs`
- [Financial Report](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/FinancialReport.xaml.cs): `corporate_chaos/views/FinancialReport.xaml.cs`
- [Quarterly Summary](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/QuarterlySummary.xaml.cs): `corporate_chaos/views/QuarterlySummary.xaml.cs`

### Story Mode

- [Story Manager](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryModeManager.cs): `corporate_chaos/systems/StoryModeManager.cs`
- [Narrative Engine](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/NarrativeEngine.cs): `corporate_chaos/systems/NarrativeEngine.cs`
- [Character Manager](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterManager.cs): `corporate_chaos/systems/CharacterManager.cs`
- [Story Branching](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryBranchingSystem.cs): `corporate_chaos/systems/StoryBranchingSystem.cs`
- [Emotional Beats](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/EmotionalBeatManager.cs): `corporate_chaos/systems/EmotionalBeatManager.cs`
- [Ending Tracker](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/EndingProbabilityTracker.cs): `corporate_chaos/systems/EndingProbabilityTracker.cs`
- [Character Advice](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterAdviceSystem.cs): `corporate_chaos/systems/CharacterAdviceSystem.cs`
- [Character Dialogue](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/CharacterDialogue.cs): `corporate_chaos/systems/CharacterDialogue.cs`
- [Story Content](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/StoryContentDistributor.cs): `corporate_chaos/systems/StoryContentDistributor.cs`
- [Joan Dialogue](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/JoanDialogue.xaml.cs): `corporate_chaos/views/JoanDialogue.xaml.cs`

### Local Game Data

- [Save Manager](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/SaveLoadManager.cs): `corporate_chaos/systems/SaveLoadManager.cs`
- [Save Records](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/GameSave.cs): `corporate_chaos/models/GameSave.cs`
- [Game Data](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/systems/DataManager.cs): `corporate_chaos/systems/DataManager.cs`
- [High Scores](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/models/GameScore.cs): `corporate_chaos/models/GameScore.cs`
- [Save Browser](https://github.com/theo-retical808/corpo_chaos/blob/main/corporate_chaos/views/SaveFileManager.xaml.cs): `corporate_chaos/views/SaveFileManager.xaml.cs`

### Other components

- **Player**

## Connections

- Player → Game Window: plays
- Game Window → Chaos Engine: runs events (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → Executive Decisions: uses decisions (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → Save Manager: loads and saves (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → Story Manager: coordinates story (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → Game Data: uses data (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → Quarterly Summary: shows summary
- Game Window → Department Panel: offers management
- Game Window → Decision Panel: offers decisions
- Game Window → Financial Report: shows financials
- Game Window → Employees: tracks employees (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Game Window → High Scores: records scores (evidence: `corporate_chaos/MainWindow.xaml.cs`)
- Story Manager → Character Manager: manages characters (evidence: `corporate_chaos/systems/StoryModeManager.cs`)
- Story Manager → Narrative Engine: uses narrative (evidence: `corporate_chaos/systems/StoryModeManager.cs`)
- Narrative Engine → Character Manager: uses characters (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Story Branching: uses branching (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Emotional Beats: uses pacing (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Story Content: uses content (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Character Advice: uses advice (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Ending Tracker: tracks endings (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Narrative Engine → Character Dialogue: gets dialogue (evidence: `corporate_chaos/systems/NarrativeEngine.cs`)
- Joan Dialogue → Story Manager: uses story mode (evidence: `corporate_chaos/views/JoanDialogue.xaml.cs`)
- Save Manager → Save Records: serializes saves (evidence: `corporate_chaos/systems/SaveLoadManager.cs`)
- Save Browser → Save Manager: browses saves (evidence: `corporate_chaos/views/SaveFileManager.xaml.cs`)
- Game Data → High Scores: uses score data (evidence: `corporate_chaos/systems/DataManager.cs`)
