# sakurai8080/party_game architecture

> Architecture diagram of the GitHub repository sakurai8080/party_game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakurai8080/party_game
- Repository: https://github.com/sakurai8080/party_game

## Overview

##### Main Components
- Game Manager & Core Systems: Represent central controllers like the GameManager (in Manager folders), NameLifeManager, and GameSetupUtility which orchestrate overall game flow.
- Mini-Game Modules: There are several dedicated mini-game modules (e.g., BallGame, BombGame, Dice, RouletteGame, SecondsGame, TheButtonGame). Each module is structured with its own Managers, UIs, and Scripts, so these should be individually represented.
- MVP Layer Structure: Since the project uses the MVP pattern, show the separation of concerns:
- Model: Data assets (ScriptableObjects in the ScritableObject folder, TweenData, and other game state information).
- View: Unity Scenes, Prefabs, UI elements (under Scenes, Resources/Prefabs, UI Toolkit assets, and UIs folders).
- Presenter: Scripts that act as coordinators between the model and view (located in each module’s UIs and parent Scripts folders like PresenterBase, BallUIPresenter, BombUIPresenter, etc.).
- Resource Management: Include separate nodes for Assets like audios (Audios, SE, BGM), materials, fonts (TextMesh Pro Resources under Assets/AssetStoreTools/TextMesh Pro), and textures.
- External Plugins & Libraries: DOTween (in Assets/Plugins/Demigiant/DOTween) for tween animations and TextMesh Pro for advanced text rendering.
- Configuration & Project Settings: Unity’s ProjectSettings and Packages (manifest.json, etc.) nodes can be abstracted as configuration/environment for the system.

##### Interactions and Relationships
- Resource Access: Show that audio components, animations (DOTween), and text rendering (TextMesh Pro) interface with the game and UI components.
- Scene Transitions: Demonstrate how different Scenes (Title, MainScene, GameSelect, mini-game scenes like BombGame.unity, Dice.unity, etc.) transition through central controllers and managers.

##### Architectural Patterns & Design Principles
- MVP Pattern: Clearly group components in three layers to illustrate separation of concerns.
- Modularity: Each mini-game component (BallGame, BombGame, etc.) is largely independent with its own dedicated folders, managers, and UI scripts. Represent these as modules that plug into the larger game framework.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Systems
    subgraph "Core Systems"
        GM["GameManager"]:::core
        NLM["NameLifeManager"]:::core
        GSU["GameSetupUtility"]:::core
    end

    %% Mini-Game Modules
    subgraph "BallGame Module"
        BGM["BallGameManager"]:::module
        BC["BallController"]:::module
        BUP["BallUIPresenter"]:::module
        BFB["BallFallButton"]:::module
        BUIC["BallUIsController"]:::module
    end

    subgraph "BombGame Module"
        BombGM["BombGameManager"]:::module
        BUP2["BombUIPresenter"]:::module
        BA["BombAnim"]:::module
        BSB["BombSelectButton"]:::module
        BUAC["BombUIsAnimationController"]:::module
    end

    subgraph "Dice Module"
        DiceGM["DiceGameManager"]:::module
        DC["DiceController"]:::module
        DUP["DiceUIPresenter"]:::module
        DRB["DiceRollButton"]:::module
        DRT["DiceResultTMP"]:::module
    end

    subgraph "RouletteGame Module"
        RC["RouletteController"]:::module
        RM["RouletteMaker"]:::module
        RUP["RouletteUIPresenter"]:::module
        RB["RouletteButton"]:::module
        RSBA["RouletteStartButtonAnim"]:::module
    end

    subgraph "SecondsGame Module"
        SG["SecondsGameManager"]:::module
        SC["SecondsController"]:::module
        SUP["SecondsUIPresenter"]:::module
        CUB["CountUpButton"]:::module
        SD["SecondsDisplay"]:::module
    end

    subgraph "TheButtonGame Module"
        TBGM["TBGameManager"]:::module
        TBBG["TBGameBackGround"]:::module
        TBUP["TBGameUIPresenter"]:::module
        TBGB["TBGameSelectBtn"]:::module
        TIG["TBIngamePopup"]:::module
        TBA["TheButtonAnimation"]:::module
    end

    %% MVP Architecture
    subgraph "MVP Architecture"
        Model["Model (TweenData)"]:::mvp
        Presenter["Presenter (Base)"]:::mvp
        View["View (Scenes & Prefabs)"]:::mvp
    end

    %% Resource Management
    subgraph "Resource Management"
        Audio["Audio (BGM & SE)"]:::resource
        Materials["Materials & Textures"]:::resource
    end

    %% External Plugins & Libraries
    subgraph "External Plugins"
        DOT["DOTween Plugin"]:::external
        TMP["TextMesh Pro"]:::external
    end

    %% Configuration & Project Settings
    subgraph "Configuration"
        PS["ProjectSettings"]:::config
        PK["Packages"]:::config
    end

    %% Connections from Core Systems to Mini-Game Modules
    GM -->|"manages"| BGM
    GM -->|"manages"| BombGM
    GM -->|"manages"| DiceGM
    GM -->|"manages"| RC
    GM -->|"manages"| SG
    GM -->|"manages"| TBGM
    GM -->|"triggers_MVP"| Presenter

    %% BallGame Module internal connections
    BGM -->|"logic_to_UI"| BUP
    BGM -->|"controls"| BC
    BFB -->|"triggers"| BUP

    %% BombGame Module internal connections
    BombGM -->|"logic_to_UI"| BUP2
    BSB -->|"selects"| BUP2
    BA -->|"animates"| BUAC

    %% Dice Module internal connections
    DiceGM -->|"controls"| DUP
    DC -->|"processes"| DUP
    DRB -->|"rolls"| DUP
    DUP -->|"updates"| DRT

    %% RouletteGame Module internal connections
    RC -->|"controls"| RUP
    RM -->|"assists"| RUP
    RB -->|"triggers"| RUP
    RUP -->|"starts"| RSBA

    %% SecondsGame Module internal connections
    SG -->|"controls"| SUP
    SC -->|"processes"| SUP
    CUB -->|"triggers"| SUP
    SUP -->|"displays"| SD

    %% TheButtonGame Module internal connections
    TBGM -->|"controls"| TBUP
    TBBG -->|"assists"| TBUP
    TBGB -->|"selects"| TBUP
    TBUP -->|"presents"| TIG
    TBUP -->|"animates"| TBA

    %% MVP Architecture interactions
    BUP -->|"updates"| Presenter
    BUP2 -->|"updates"| Presenter
    DUP -->|"updates"| Presenter
    RUP -->|"updates"| Presenter
    SUP -->|"updates"| Presenter
    TBUP -->|"updates"| Presenter

    Presenter -->|"update_model"| Model
    Presenter -->|"update_view"| View

    %% Resource Management to Views
    Audio -->|"feeds"| View
    Materials -->|"feeds"| View

    %% External Plugins to Views
    DOT -->|"animates"| View
    TMP -->|"renders"| View

    %% Configuration to Core Systems
    PS -->|"configures"| GM
    PK -->|"configures"| GM

    %% Styling classes
    classDef core fill:#ffcccc,stroke:#cc0000,stroke-width:2px;
    classDef module fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef mvp fill:#ccccff,stroke:#0000cc,stroke-width:2px;
    classDef resource fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef external fill:#ffccff,stroke:#990099,stroke-width:2px;
    classDef config fill:#d9d9d9,stroke:#666666,stroke-width:2px;

    %% Click Events for Core Systems
    click GM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Manager/GameManager.cs"
    click NLM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Manager/NameLifeManager.cs"
    click GSU "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Manager/GameSetupUtility.cs"

    %% Click Events for BallGame Module
    click BGM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BallGame/Managers/BallGameManager.cs"
    click BC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BallGame/Managers/BallController.cs"
    click BUP "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BallGame/UIs/BallUIPresenter.cs"
    click BFB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BallGame/UIs/BallFallButton.cs"
    click BUIC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BallGame/UIs/BallUIsController.cs"

    %% Click Events for BombGame Module
    click BombGM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BombGame/Manager/BombGameManager.cs"
    click BUP2 "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BombGame/UIs/BombUIPresenter.cs"
    click BA "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BombGame/UIs/BombAnim.cs"
    click BSB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BombGame/UIs/BombSelectButton.cs"
    click BUAC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/BombGame/UIs/BombUIsAnimationController.cs"

    %% Click Events for Dice Module
    click DiceGM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Dice/Managers/DiceGameManager.cs"
    click DC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Dice/Managers/DiceController.cs"
    click DUP "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Dice/Uis/DiceUIPresenter.cs"
    click DRB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Dice/Uis/DiceRollButton.cs"
    click DRT "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Dice/Uis/DiceResultTMP.cs"

    %% Click Events for RouletteGame Module
    click RC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/RouletteGame/Managers/RouletteController.cs"
    click RM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/RouletteGame/Managers/RouletteMaker.cs"
    click RUP "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/RouletteGame/UIs/RouletteUIPresenter.cs"
    click RB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/RouletteGame/UIs/RouletteButton.cs"
    click RSBA "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/RouletteGame/UIs/RouletteStartButtonAnim.cs"

    %% Click Events for SecondsGame Module
    click SG "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/SecondsGame/Manager/SecondsGameManager.cs"
    click SC "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/SecondsGame/Manager/SecondsController.cs"
    click SUP "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/SecondsGame/UIs/SecondsUIPresenter.cs"
    click CUB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/SecondsGame/UIs/CountUpButton.cs"
    click SD "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/SecondsGame/UIs/SecondsDisplay.cs"

    %% Click Events for TheButtonGame Module
    click TBGM "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/Managers/TBGameManager.cs"
    click TBBG "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/Managers/TBGameBackGround.cs"
    click TBUP "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/UIs/TBGameUIPresenter.cs"
    click TBGB "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/UIs/TBGameSelectBtn.cs"
    click TIG "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/UIs/TBIngamePopup.cs"
    click TBA "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/TheButtonGame/UIs/TheButtonAnimation.cs"

    %% Click Events for MVP Architecture
    click Model "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/ScritableObject/TweenData.cs"
    click Presenter "https://github.com/sakurai8080/party_game/blob/main/Assets/Scripts/Base/PresenterBase.cs"

    %% Click Events for External Plugins & Libraries
    click DOT "https://github.com/sakurai8080/party_game/tree/main/Assets/Plugins/Demigiant/DOTween"
    click TMP "https://github.com/sakurai8080/party_game/tree/main/Assets/AssetStoreTools/TextMesh Pro"

    %% Click Events for Configuration
    click PK "https://github.com/sakurai8080/party_game/blob/main/Packages/manifest.json"
    click PS "https://github.com/sakurai8080/party_game/tree/main/ProjectSettings"
```
