# icecat14159/-- architecture

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

- Interactive diagram: https://gitdiagram.com/icecat14159/--
- Repository: https://github.com/icecat14159/--

## Overview

這是一個瀏覽器版海盜棋地圖工具：使用者操作互動式六角地圖，佔領海域並查看公會設施統計。主要階段是地圖呈現與操作、連通／封鎖及階段規則計算、公會管理與排行榜。README 僅提供產品名稱；圖中關係依據已展示的程式片段，未展示的頁面載入與其他功能不作推定。

Main entry points: [`hex.js`](https://github.com/icecat14159/--/blob/main/hex.js) (六角地圖), [`guildUI.js`](https://github.com/icecat14159/--/blob/main/guildUI.js) (公會與排行榜), [`logic.js`](https://github.com/icecat14159/--/blob/main/logic.js) (連通與階段), [`config.js`](https://github.com/icecat14159/--/blob/main/config.js) (地圖與公會設定)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_map["地圖操作"]
  node_mapview["六角地圖<br/>[hex.js]"]
end

subgraph group_rules["地圖規則"]
  node_territory["連通與階段<br/>[logic.js]"]
end

subgraph group_guilds["公會管理"]
  node_guildui["公會與排行榜<br/>[guildUI.js]"]
end

node_player(("玩家"))
node_mapconfig["地圖與公會設定<br/>[config.js]"]

node_player -->|"操作地圖"| node_mapview
node_mapview -->|"重算狀態"| node_territory
node_territory -->|"更新圖層"| node_mapview
node_guildui -->|"切換階段"| node_territory
node_guildui -->|"更新顏色"| node_mapview
node_mapview -->|"讀取公會"| node_guildui
node_mapconfig -->|"提供地圖資料"| node_mapview
node_mapconfig -->|"提供公會設定"| node_guildui

click node_mapview "https://github.com/icecat14159/--/blob/main/hex.js"
click node_territory "https://github.com/icecat14159/--/blob/main/logic.js"
click node_guildui "https://github.com/icecat14159/--/blob/main/guildUI.js"
click node_mapconfig "https://github.com/icecat14159/--/blob/main/config.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_mapview toneBlue
class node_territory toneAmber
class node_guildui toneMint
class node_player toneIndigo
class node_mapconfig toneTeal
```

## Components

### 地圖操作

- [六角地圖](https://github.com/icecat14159/--/blob/main/hex.js): `hex.js`

### 地圖規則

- [連通與階段](https://github.com/icecat14159/--/blob/main/logic.js): `logic.js`

### 公會管理

- [公會與排行榜](https://github.com/icecat14159/--/blob/main/guildUI.js): `guildUI.js`

### Other components

- **玩家**
- [地圖與公會設定](https://github.com/icecat14159/--/blob/main/config.js): `config.js`

## Connections

- 玩家 → 六角地圖: 操作地圖 (evidence: `hex.js`)
- 六角地圖 → 連通與階段: 重算狀態 (evidence: `hex.js`)
- 連通與階段 → 六角地圖: 更新圖層 (evidence: `logic.js`)
- 公會與排行榜 → 連通與階段: 切換階段 (evidence: `guildUI.js`)
- 公會與排行榜 → 六角地圖: 更新顏色 (evidence: `guildUI.js`)
- 六角地圖 → 公會與排行榜: 讀取公會 (evidence: `hex.js`)
- 地圖與公會設定 → 六角地圖: 提供地圖資料 (evidence: `hex.js`)
- 地圖與公會設定 → 公會與排行榜: 提供公會設定 (evidence: `guildUI.js`)
