# filipmaciejak/zpi architecture

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

- Interactive diagram: https://gitdiagram.com/filipmaciejak/zpi
- Repository: https://github.com/filipmaciejak/zpi

## Overview

##### Project type and purpose
- This is a cross-platform Unity game (code name “zpi”) with two Unity projects:
– “pc” folder: the core game running on PC/Windows, acting as the authoritative server.
– “mobile” folder: a client app for Android/iOS that serves as a controller/interface.
- Purpose: players on mobile devices scan a QR code to pair with the PC game and control game modules (cannon, movement, shield, energy, gyroscope, etc.) in real time via Unity Transport networking.

##### File structure
- Top-level:
– documentation: Doxygen/LaTeX code documentation for both mobile and PC code.
– mobile: full Unity project with Assets/Scripts, Scenes, Resources, Prefabs.
– pc: full Unity project with Assets/Scripts, Scenes, Prefabs, Resources.
- Key directories:
– mobile/Assets/Scripts/UnityTransportClientManager.cs: client network layer.
– pc/Assets/Scripts/UnityTransportServerManager.cs: server network layer.
– Scripts subfolders organize by feature (CannonModule, MovementModule, MainMenu, etc.).
– Scenes folder in each project encapsulates specific game states or module UIs.
- Configuration files:
– Packages/manifest.json: Unity package dependencies.
– ProjectSettings: engine and input configuration for each platform.

##### Readme insights
- Doxygen output suggests a class-based modular structure with controllers, managers, and events.

## Diagram (Mermaid)

```mermaid
graph TB
  subgraph "PC Game Server"
    UTS["UnityTransportServerManager"]:::server
    GSM["GameStateManager"]:::server
    MEM["ModuleEventManager"]:::server
    MG["MapGenerator"]:::server
    GMODE["DeathmatchGameMode"]:::server
    QRS["QrCodeScript"]:::server
    SM["ShootingModule"]:::server
    MM["MovementModule"]:::server
    SCM["ShieldChargingModule"]:::server
    ERM["EnergyRechargingModule"]:::server
    GYM["GyroscopeModule"]:::server
    MMB["MainMenuButton"]:::server
    LGB["LeaveGameButton"]:::server
    RB["ResumeButton"]:::server
    SWT["SetWinnerText"]:::server

    UTS --> GSM
    GSM --> MEM
    MEM --> SM
    MEM --> MM
    MEM --> SCM
    MEM --> ERM
    MEM --> GYM
    GSM --> MG
    GSM --> GMODE
    GSM --> QRS
  end

  subgraph "Mobile Client"
    UTC["UnityTransportClientManager"]:::client
    MGM["GameManager"]:::client
    CM["ControlsManager"]:::client
    QRM["QrReadingManager"]:::client
    Btn["Button"]:::client
    JC["JoystickController"]:::client
    TH["TouchHelper"]:::client
    CH["CameraHandler"]:::client
    MMM["MenuManager"]:::client
    PB["PlayerBar"]:::client
    CMM["CannonModuleManager"]:::client
    AC["AimController"]:::client
    AB["AmmoBay"]:::client
    SLP["Shell.prefab"]:::client
    MVM["MovementModuleManager"]:::client
    SLV["SpeedLever"]:::client
    SSL["SteeringSlider"]:::client
    SMOD["ShieldModuleManager"]:::client
    EMOD["EnergyModuleManager"]:::client
    GYMOD["GyroscopeModuleManager"]:::client
    EMM["ElectricalMinigameManager"]:::client

    Btn --> CM
    JC --> CM
    TH --> CM
    CH --> CM
    MMM --> CM
    PB --> CM
    CMM --> UTC
    AC --> UTC
    AB --> UTC
    SLP --> UTC
    MVM --> UTC
    SLV --> UTC
    SSL --> UTC
    SMOD --> UTC
    EMOD --> UTC
    GYMOD --> UTC
    EMM --> UTC
    QRM --> UTC
    MGM --> UTC
    CM --> UTC
  end

  UTC -->|"UDP"| UTS
  UTS -->|"UDP"| UTC

  classDef server fill:#ADD8E6,stroke:#000,stroke-width:1px;
  classDef client fill:#90EE90,stroke:#000,stroke-width:1px;

  click UTS "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/UnityTransportServerManager.cs"
  click GSM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/GameStateManager.cs"
  click MEM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModuleEventManager.cs"
  click MG "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/MapGenerator.cs"
  click GMODE "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/DeathmatchGameMode.cs"
  click SM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModulesScripts/ShootingModule.cs"
  click MM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModulesScripts/MovementModule.cs"
  click SCM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModulesScripts/ShieldChargingModule.cs"
  click ERM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModulesScripts/EnergyRechargingModule.cs"
  click GYM "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ModulesScripts/GyroscopeModule.cs"
  click QRS "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/QrCodeScript.cs"
  click MMB "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/MainMenuButton.cs"
  click LGB "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/LeaveGameButton.cs"
  click RB "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/ResumeButton.cs"
  click SWT "https://github.com/filipmaciejak/zpi/blob/main/pc/Assets/Scripts/SetWinnerText.cs"
  click UTC "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/UnityTransportClientManager.cs"
  click MGM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/GameManager.cs"
  click CM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/ControlsManager.cs"
  click QRM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/QrReadingManager.cs"
  click Btn "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/Button.cs"
  click JC "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/JoystickController.cs"
  click TH "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/TouchHelper.cs"
  click CH "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/CameraHandler.cs"
  click MMM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/MainMenu/MenuManager.cs"
  click PB "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/PlayerBar.cs"
  click CMM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/CannonModule/CannonModuleManager.cs"
  click AC "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/CannonModule/AimController.cs"
  click AB "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/CannonModule/AmmoBay.cs"
  click SLP "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/CannonModule/Shell.prefab"
  click MVM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/MovementModule/MovementModuleManager.cs"
  click SLV "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/MovementModule/SpeedLever.cs"
  click SSL "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/MovementModule/SteeringSlider.cs"
  click SMOD "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/ShieldModuleManager.cs"
  click EMOD "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/EnergyModuleManager.cs"
  click GYMOD "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/GyroscopeModuleManager.cs"
  click EMM "https://github.com/filipmaciejak/zpi/blob/main/mobile/Assets/Scripts/ElectricalMinigameManager.cs"
```
