# libccy/noname architecture

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

## Overview

《无名杀》是可在浏览器或手机 WebView 游玩的卡牌游戏。玩家启动游戏并选择玩法后，游戏初始化加载角色与卡牌内容，进入对应模式，由事件系统推进对局，界面呈现并接收操作；联网模式由服务端转发房间与玩家消息。README 主要说明客户端运行环境与社区背景，未详细描述玩法；下图按目录与抽样源码呈现架构，未抽样模块仅以目录级节点概括，连线保持保守。

Main entry points: [`noname/init/index.js`](https://github.com/libccy/noname/blob/master/noname/init/index.js) (启动初始化), [`noname/ui/index.js`](https://github.com/libccy/noname/blob/master/noname/ui/index.js) (游戏界面), [`noname/status/index.js`](https://github.com/libccy/noname/blob/master/noname/status/index.js) (对局状态), [`mode`](https://github.com/libccy/noname/tree/master/mode) (游戏模式)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["运行时核心"]
  node_init["启动初始化<br/>[index.js]"]
  node_engine["核心库<br/>[index.js]"]
  node_lookup["游戏查询<br/>[index.js]"]
  node_state["对局状态<br/>[index.js]"]
  node_events["事件管理"]
  node_pausing["暂停管理<br/>[PauseManager.ts]"]
  node_interface["游戏界面<br/>[index.js]"]
end

subgraph group_gameplay["对局玩法"]
  node_modes["游戏模式"]
end

subgraph group_content["游戏内容"]
  node_cards["卡牌包"]
  node_characters["角色包"]
end

subgraph group_network["联网与扩展"]
  node_extensions["扩展模块"]
  node_server["联机服务端<br/>[server.js]"]
end

node_player(("玩家"))
node_websocket["WebSocket服务"]

node_player -->|"启动游戏"| node_init
node_init -->|"初始化依赖"| node_engine
node_init -->|"导入查询"| node_lookup
node_init -->|"初始化状态"| node_state
node_init -->|"初始化界面"| node_interface
node_state -->|"创建管理器"| node_events
node_state -->|"创建管理器"| node_pausing
node_interface -->|"读取游戏库"| node_engine
node_interface -->|"查询游戏数据"| node_lookup
node_player -->|"操作对局"| node_interface
node_modes -.->|"使用内容"| node_characters
node_modes -.->|"使用内容"| node_cards
node_init -.->|"加载扩展"| node_extensions
node_server -->|"创建监听"| node_websocket
node_player -.->|"联网连接"| node_server

click node_init "https://github.com/libccy/noname/blob/master/noname/init/index.js"
click node_engine "https://github.com/libccy/noname/blob/master/noname/library/index.js"
click node_lookup "https://github.com/libccy/noname/blob/master/noname/get/index.js"
click node_state "https://github.com/libccy/noname/blob/master/noname/status/index.js"
click node_events "https://github.com/libccy/noname/blob/master/noname/library/element/GameEvent/GameEventManager.ts"
click node_pausing "https://github.com/libccy/noname/blob/master/noname/game/PauseManager.ts"
click node_interface "https://github.com/libccy/noname/blob/master/noname/ui/index.js"
click node_modes "https://github.com/libccy/noname/tree/master/mode"
click node_cards "https://github.com/libccy/noname/tree/master/card"
click node_characters "https://github.com/libccy/noname/tree/master/character"
click node_extensions "https://github.com/libccy/noname/tree/master/extension"
click node_server "https://github.com/libccy/noname/blob/master/game/server.js"

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_init,node_engine,node_lookup,node_state,node_events,node_pausing,node_interface toneBlue
class node_modes toneAmber
class node_cards,node_characters toneMint
class node_extensions,node_server toneRose
class node_player,node_websocket toneIndigo
```

## Components

### 运行时核心

- [启动初始化](https://github.com/libccy/noname/blob/master/noname/init/index.js): `noname/init/index.js`
- [核心库](https://github.com/libccy/noname/blob/master/noname/library/index.js): `noname/library/index.js`
- [游戏查询](https://github.com/libccy/noname/blob/master/noname/get/index.js): `noname/get/index.js`
- [对局状态](https://github.com/libccy/noname/blob/master/noname/status/index.js): `noname/status/index.js`
- [事件管理](https://github.com/libccy/noname/blob/master/noname/library/element/GameEvent/GameEventManager.ts): `noname/library/element/GameEvent/GameEventManager.ts`
- [暂停管理](https://github.com/libccy/noname/blob/master/noname/game/PauseManager.ts): `noname/game/PauseManager.ts`
- [游戏界面](https://github.com/libccy/noname/blob/master/noname/ui/index.js): `noname/ui/index.js`

### 对局玩法

- [游戏模式](https://github.com/libccy/noname/tree/master/mode): `mode`

### 游戏内容

- [卡牌包](https://github.com/libccy/noname/tree/master/card): `card`
- [角色包](https://github.com/libccy/noname/tree/master/character): `character`

### 联网与扩展

- [扩展模块](https://github.com/libccy/noname/tree/master/extension): `extension`
- [联机服务端](https://github.com/libccy/noname/blob/master/game/server.js): `game/server.js`

### Other components

- **玩家**
- **WebSocket服务**

## Connections

- 玩家 → 启动初始化: 启动游戏
- 启动初始化 → 核心库: 初始化依赖
- 启动初始化 → 游戏查询: 导入查询
- 启动初始化 → 对局状态: 初始化状态
- 启动初始化 → 游戏界面: 初始化界面
- 对局状态 → 事件管理: 创建管理器
- 对局状态 → 暂停管理: 创建管理器
- 游戏界面 → 核心库: 读取游戏库
- 游戏界面 → 游戏查询: 查询游戏数据
- 玩家 → 游戏界面: 操作对局
- 游戏模式 → 角色包: 使用内容
- 游戏模式 → 卡牌包: 使用内容
- 启动初始化 → 扩展模块: 加载扩展
- 联机服务端 → WebSocket服务: 创建监听
- 玩家 → 联机服务端: 联网连接
