# llr104/slgclient architecture

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

- Interactive diagram: https://gitdiagram.com/llr104/slgclient
- Repository: https://github.com/llr104/slgclient

## Overview

This is a Cocos Creator 3.4 strategy-game client demo. Its main player-facing loop is logging in, managing a city and generals, then using the world map to move armies and contest territory; other documented features include draws, skills, battle reports, alliances, and chat. The tree exposes scenes, prefabs, and game data, but no client scripts. Accordingly, the graph maps documented capabilities to those assets and avoids asserting unverified screen wiring or runtime call sequences.

Main entry points: [`assets/resources/config/basic.json`](https://github.com/llr104/slgclient/blob/main/assets/resources/config/basic.json) (Game configuration), [`assets/prefab/login.prefab`](https://github.com/llr104/slgclient/blob/main/assets/prefab/login.prefab) (Login), [`assets/MainScene.scene`](https://github.com/llr104/slgclient/blob/main/assets/MainScene.scene) (Main scene), [`assets/MapToolScene.scene`](https://github.com/llr104/slgclient/blob/main/assets/MapToolScene.scene) (Map scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client entry"]
  node_login["Login<br/>[login.prefab]"]
  node_main["Main scene<br/>[MainScene.scene]"]
end

subgraph group_strategy["World strategy"]
  node_mapscene["Map scene<br/>[MapToolScene.scene]"]
  node_mapui["Map interactions<br/>[MapClickUI.prefab]"]
  node_army["Army movement<br/>[ArmyArrow.prefab]"]
end

subgraph group_management["City and generals"]
  node_city["City facilities"]
  node_armysetting["Army recruitment"]
  node_general["General roster"]
  node_skills["Skills<br/>[Skill.prefab]"]
  node_draw["General draw<br/>[Draw.prefab]"]
end

subgraph group_social["Social and reports"]
  node_battle["Battle reports<br/>[WarReport.prefab]"]
  node_alliance["Alliance<br/>[Union.prefab]"]
  node_chat["Chat<br/>[Chat.prefab]"]
end

subgraph group_data["Game data"]
  node_config["Game configuration<br/>[basic.json]"]
  node_gamedata["Game data"]
end

node_player(("Player"))
node_server{{"Game server"}}
node_gate{{"Gate server"}}

node_player -->|"uses"| node_login
node_player -->|"plays"| node_main
node_player -->|"plays"| node_mapscene
node_player -->|"manages"| node_city
node_player -->|"recruits"| node_armysetting
node_player -->|"manages"| node_general
node_player -->|"views"| node_skills
node_player -->|"draws"| node_draw
node_player -->|"interacts"| node_mapui
node_player -->|"commands"| node_army
node_player -->|"reviews"| node_battle
node_player -->|"joins"| node_alliance
node_player -->|"chats"| node_chat
node_config -.->|"configures endpoint"| node_server
node_config -.->|"configures endpoint"| node_gate

click node_login "https://github.com/llr104/slgclient/blob/main/assets/prefab/login.prefab"
click node_main "https://github.com/llr104/slgclient/blob/main/assets/MainScene.scene"
click node_mapscene "https://github.com/llr104/slgclient/blob/main/assets/MapToolScene.scene"
click node_mapui "https://github.com/llr104/slgclient/blob/main/assets/prefab/map/MapClickUI.prefab"
click node_army "https://github.com/llr104/slgclient/blob/main/assets/prefab/map/ArmyArrow.prefab"
click node_city "https://github.com/llr104/slgclient/blob/main/assets/prefab/CityFacilityItem.prefab"
click node_armysetting "https://github.com/llr104/slgclient/blob/main/assets/prefab/CityArmySetting.prefab"
click node_general "https://github.com/llr104/slgclient/blob/main/assets/prefab/GeneralRoster.prefab"
click node_skills "https://github.com/llr104/slgclient/blob/main/assets/prefab/Skill.prefab"
click node_draw "https://github.com/llr104/slgclient/blob/main/assets/prefab/Draw.prefab"
click node_battle "https://github.com/llr104/slgclient/blob/main/assets/prefab/WarReport.prefab"
click node_alliance "https://github.com/llr104/slgclient/blob/main/assets/prefab/Union.prefab"
click node_chat "https://github.com/llr104/slgclient/blob/main/assets/prefab/Chat.prefab"
click node_config "https://github.com/llr104/slgclient/blob/main/assets/resources/config/basic.json"
click node_gamedata "https://github.com/llr104/slgclient/tree/main/assets/resources/config/json"

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_login,node_main toneBlue
class node_mapscene,node_mapui,node_army toneAmber
class node_city,node_armysetting,node_general,node_skills,node_draw,node_server,node_gate toneMint
class node_battle,node_alliance,node_chat toneRose
class node_config,node_gamedata,node_player toneIndigo
```

## Components

### Client entry

- [Login](https://github.com/llr104/slgclient/blob/main/assets/prefab/login.prefab): `assets/prefab/login.prefab`
- [Main scene](https://github.com/llr104/slgclient/blob/main/assets/MainScene.scene): `assets/MainScene.scene`

### World strategy

- [Map scene](https://github.com/llr104/slgclient/blob/main/assets/MapToolScene.scene): `assets/MapToolScene.scene`
- [Map interactions](https://github.com/llr104/slgclient/blob/main/assets/prefab/map/MapClickUI.prefab): `assets/prefab/map/MapClickUI.prefab`
- [Army movement](https://github.com/llr104/slgclient/blob/main/assets/prefab/map/ArmyArrow.prefab): `assets/prefab/map/ArmyArrow.prefab`

### City and generals

- [City facilities](https://github.com/llr104/slgclient/blob/main/assets/prefab/CityFacilityItem.prefab): `assets/prefab/CityFacilityItem.prefab`
- [Army recruitment](https://github.com/llr104/slgclient/blob/main/assets/prefab/CityArmySetting.prefab): `assets/prefab/CityArmySetting.prefab`
- [General roster](https://github.com/llr104/slgclient/blob/main/assets/prefab/GeneralRoster.prefab): `assets/prefab/GeneralRoster.prefab`
- [Skills](https://github.com/llr104/slgclient/blob/main/assets/prefab/Skill.prefab): `assets/prefab/Skill.prefab`
- [General draw](https://github.com/llr104/slgclient/blob/main/assets/prefab/Draw.prefab): `assets/prefab/Draw.prefab`

### Social and reports

- [Battle reports](https://github.com/llr104/slgclient/blob/main/assets/prefab/WarReport.prefab): `assets/prefab/WarReport.prefab`
- [Alliance](https://github.com/llr104/slgclient/blob/main/assets/prefab/Union.prefab): `assets/prefab/Union.prefab`
- [Chat](https://github.com/llr104/slgclient/blob/main/assets/prefab/Chat.prefab): `assets/prefab/Chat.prefab`

### Game data

- [Game configuration](https://github.com/llr104/slgclient/blob/main/assets/resources/config/basic.json): `assets/resources/config/basic.json`
- [Game data](https://github.com/llr104/slgclient/tree/main/assets/resources/config/json): `assets/resources/config/json`

### Other components

- **Player**
- **Game server**
- **Gate server**

## Connections

- Player → Login: uses
- Player → Main scene: plays
- Player → Map scene: plays
- Player → City facilities: manages
- Player → Army recruitment: recruits
- Player → General roster: manages
- Player → Skills: views
- Player → General draw: draws
- Player → Map interactions: interacts
- Player → Army movement: commands
- Player → Battle reports: reviews
- Player → Alliance: joins
- Player → Chat: chats
- Game configuration → Game server: configures endpoint
- Game configuration → Gate server: configures endpoint
