# luangqnt/mingwit architecture

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

- Interactive diagram: https://gitdiagram.com/luangqnt/mingwit
- Repository: https://github.com/luangqnt/mingwit

## Overview

Mingwit is a Java desktop virtual-pet game. The main flow is menu → save selection or pet creation → care and inventory gameplay; players can also fish for rewards, then continue or have progress saved locally. The graph includes documented care-history, medication, customization, and shop capabilities, though their implementation was not sampled; those are represented at the supported `src` directory level. Edges are limited to calls and wiring shown in excerpts, the source index, or the README.

Main entry points: [`src/Window.java`](https://github.com/luangqnt/mingwit/blob/main/src/Window.java) (Game window), [`src/InventoryPanel.java`](https://github.com/luangqnt/mingwit/blob/main/src/InventoryPanel.java) (Inventory), [`src/GamePanel.java`](https://github.com/luangqnt/mingwit/blob/main/src/GamePanel.java) (Pet room), [`src/SaveFile.java`](https://github.com/luangqnt/mingwit/blob/main/src/SaveFile.java) (Save data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_pet_setup["Pet creation"]
  node_main_menu["Main menu<br/>[MainMenuPanel.java]"]
  node_window["Game window<br/>[Window.java]"]
  node_scenes["Scene routing<br/>[SceneManager.java]"]
  node_settings["Settings<br/>[SettingsPanel.java]"]
end

subgraph group_care["Pet care"]
  node_player["Player<br/>[Player.java]"]
  node_pet["Pet status<br/>[Pet.java]"]
  node_medication["Medication records"]
  node_care_history["Care history"]
  node_inventory["Inventory"]
  node_items["Items and stacks<br/>[ItemStack.java]"]
end

subgraph group_gameplay["Fishing and rewards"]
  node_game_panel["Pet room<br/>[GamePanel.java]"]
  node_fishing["Fishing game<br/>[FishingPanel.java]"]
  node_fish["Fish rewards<br/>[Fish.java]"]
  node_shop["Accessory shop"]
end

subgraph group_persistence["Save persistence"]
  node_save_select["Save selection<br/>[SavePanel.java]"]
  node_save_file["Save data<br/>[SaveFile.java]"]
  node_save_storage[("Local save storage<br/>[SaveStorage.java]")]
end

subgraph group_ui["Shared presentation"]
  node_sound["Audio playback<br/>[SoundManager.java]"]
  node_sprites["Sprite loading<br/>[SpriteLoader.java]"]
  node_fonts["Font loading<br/>[FontManager.java]"]
end

node_user(("Player"))

node_user -->|"starts game"| node_main_menu
node_main_menu -->|"notifies actions"| node_window
node_window -->|"opens saves"| node_save_select
node_save_select -->|"selects slot"| node_window
node_window -->|"opens creation"| node_pet_setup
node_pet_setup -->|"creates pet"| node_pet
node_window -->|"creates save"| node_save_file
node_window -->|"loads and saves"| node_save_storage
node_save_storage -->|"persists records"| node_save_file
node_save_file -->|"holds state"| node_player
node_save_file -->|"holds state"| node_pet
node_window -->|"opens gameplay"| node_game_panel
node_window -->|"opens fishing"| node_fishing
node_window -->|"routes screens"| node_scenes
node_game_panel -->|"routes fishing"| node_scenes
node_game_panel -->|"shows inventory"| node_inventory
node_inventory -->|"updates items"| node_player
node_inventory -->|"uses items"| node_pet
node_inventory -->|"uses stacks"| node_items
node_items -->|"applies item"| node_pet
node_fishing -->|"awards rewards"| node_player
node_fishing -->|"rolls catch"| node_fish
node_fish -->|"is an item"| node_items
node_settings -->|"adjusts audio"| node_sound
node_game_panel -->|"plays effects"| node_sound
node_inventory -->|"loads images"| node_sprites
node_save_select -->|"loads font"| node_fonts
node_user -.->|"tracks treatment"| node_medication
node_user -.->|"reviews records"| node_care_history
node_user -.->|"spends coins"| node_shop

click node_player "https://github.com/luangqnt/mingwit/blob/main/src/Player.java"
click node_pet "https://github.com/luangqnt/mingwit/blob/main/src/Pet.java"
click node_medication "https://github.com/luangqnt/mingwit/tree/main/src"
click node_care_history "https://github.com/luangqnt/mingwit/tree/main/src"
click node_pet_setup "https://github.com/luangqnt/mingwit/blob/main/src/PetCreationPanel.java"
click node_main_menu "https://github.com/luangqnt/mingwit/blob/main/src/MainMenuPanel.java"
click node_window "https://github.com/luangqnt/mingwit/blob/main/src/Window.java"
click node_scenes "https://github.com/luangqnt/mingwit/blob/main/src/SceneManager.java"
click node_save_select "https://github.com/luangqnt/mingwit/blob/main/src/SavePanel.java"
click node_save_file "https://github.com/luangqnt/mingwit/blob/main/src/SaveFile.java"
click node_save_storage "https://github.com/luangqnt/mingwit/blob/main/src/SaveStorage.java"
click node_game_panel "https://github.com/luangqnt/mingwit/blob/main/src/GamePanel.java"
click node_inventory "https://github.com/luangqnt/mingwit/blob/main/src/InventoryPanel.java"
click node_items "https://github.com/luangqnt/mingwit/blob/main/src/ItemStack.java"
click node_fishing "https://github.com/luangqnt/mingwit/blob/main/src/FishingPanel.java"
click node_fish "https://github.com/luangqnt/mingwit/blob/main/src/Fish.java"
click node_shop "https://github.com/luangqnt/mingwit/tree/main/src"
click node_settings "https://github.com/luangqnt/mingwit/blob/main/src/SettingsPanel.java"
click node_sound "https://github.com/luangqnt/mingwit/blob/main/src/SoundManager.java"
click node_sprites "https://github.com/luangqnt/mingwit/blob/main/src/SpriteLoader.java"
click node_fonts "https://github.com/luangqnt/mingwit/blob/main/src/FontManager.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_pet_setup,node_main_menu,node_window,node_scenes,node_settings toneBlue
class node_player,node_pet,node_medication,node_care_history,node_inventory,node_items toneAmber
class node_game_panel,node_fishing,node_fish,node_shop toneMint
class node_save_select,node_save_file,node_save_storage toneRose
class node_sound,node_sprites,node_fonts,node_user toneIndigo
```

## Components

### Application flow

- [Pet creation](https://github.com/luangqnt/mingwit/blob/main/src/PetCreationPanel.java): `src/PetCreationPanel.java`
- [Main menu](https://github.com/luangqnt/mingwit/blob/main/src/MainMenuPanel.java): `src/MainMenuPanel.java`
- [Game window](https://github.com/luangqnt/mingwit/blob/main/src/Window.java): `src/Window.java`
- [Scene routing](https://github.com/luangqnt/mingwit/blob/main/src/SceneManager.java): `src/SceneManager.java`
- [Settings](https://github.com/luangqnt/mingwit/blob/main/src/SettingsPanel.java): `src/SettingsPanel.java`

### Pet care

- [Player](https://github.com/luangqnt/mingwit/blob/main/src/Player.java): `src/Player.java`
- [Pet status](https://github.com/luangqnt/mingwit/blob/main/src/Pet.java): `src/Pet.java`
- [Medication records](https://github.com/luangqnt/mingwit/tree/main/src): `src`
- [Care history](https://github.com/luangqnt/mingwit/tree/main/src): `src`
- [Inventory](https://github.com/luangqnt/mingwit/blob/main/src/InventoryPanel.java): `src/InventoryPanel.java`
- [Items and stacks](https://github.com/luangqnt/mingwit/blob/main/src/ItemStack.java): `src/ItemStack.java`

### Fishing and rewards

- [Pet room](https://github.com/luangqnt/mingwit/blob/main/src/GamePanel.java): `src/GamePanel.java`
- [Fishing game](https://github.com/luangqnt/mingwit/blob/main/src/FishingPanel.java): `src/FishingPanel.java`
- [Fish rewards](https://github.com/luangqnt/mingwit/blob/main/src/Fish.java): `src/Fish.java`
- [Accessory shop](https://github.com/luangqnt/mingwit/tree/main/src): `src`

### Save persistence

- [Save selection](https://github.com/luangqnt/mingwit/blob/main/src/SavePanel.java): `src/SavePanel.java`
- [Save data](https://github.com/luangqnt/mingwit/blob/main/src/SaveFile.java): `src/SaveFile.java`
- [Local save storage](https://github.com/luangqnt/mingwit/blob/main/src/SaveStorage.java): `src/SaveStorage.java`

### Shared presentation

- [Audio playback](https://github.com/luangqnt/mingwit/blob/main/src/SoundManager.java): `src/SoundManager.java`
- [Sprite loading](https://github.com/luangqnt/mingwit/blob/main/src/SpriteLoader.java): `src/SpriteLoader.java`
- [Font loading](https://github.com/luangqnt/mingwit/blob/main/src/FontManager.java): `src/FontManager.java`

### Other components

- **Player**

## Connections

- Player → Main menu: starts game
- Main menu → Game window: notifies actions (evidence: `src/Window.java`)
- Game window → Save selection: opens saves (evidence: `src/Window.java`)
- Save selection → Game window: selects slot (evidence: `src/Window.java`)
- Game window → Pet creation: opens creation (evidence: `src/Window.java`)
- Pet creation → Pet status: creates pet (evidence: `src/PetCreationPanel.java`)
- Game window → Save data: creates save (evidence: `src/Window.java`)
- Game window → Local save storage: loads and saves (evidence: `src/Window.java`)
- Local save storage → Save data: persists records (evidence: `src/SaveStorage.java`)
- Save data → Player: holds state (evidence: `src/SaveFile.java`)
- Save data → Pet status: holds state (evidence: `src/SaveFile.java`)
- Game window → Pet room: opens gameplay (evidence: `src/Window.java`)
- Game window → Fishing game: opens fishing (evidence: `src/Window.java`)
- Game window → Scene routing: routes screens (evidence: `src/Window.java`)
- Pet room → Scene routing: routes fishing (evidence: `src/GamePanel.java`)
- Pet room → Inventory: shows inventory (evidence: `src/GamePanel.java`)
- Inventory → Player: updates items (evidence: `src/InventoryPanel.java`)
- Inventory → Pet status: uses items (evidence: `src/InventoryPanel.java`)
- Inventory → Items and stacks: uses stacks (evidence: `src/InventoryPanel.java`)
- Items and stacks → Pet status: applies item (evidence: `src/ItemStack.java`)
- Fishing game → Player: awards rewards (evidence: `src/FishingPanel.java`)
- Fishing game → Fish rewards: rolls catch (evidence: `src/FishingPanel.java`)
- Fish rewards → Items and stacks: is an item (evidence: `src/Fish.java`)
- Settings → Audio playback: adjusts audio (evidence: `src/SettingsPanel.java`)
- Pet room → Audio playback: plays effects (evidence: `src/GamePanel.java`)
- Inventory → Sprite loading: loads images (evidence: `src/InventoryPanel.java`)
- Save selection → Font loading: loads font (evidence: `src/SavePanel.java`)
- Player → Medication records: tracks treatment (evidence: `README.md`)
- Player → Care history: reviews records (evidence: `README.md`)
- Player → Accessory shop: spends coins (evidence: `README.md`)
