Files
2026-07-29 22:40:37 +08:00

163 lines
7.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 模拟宗门 — 项目目录结构
## 结构总览
```
模拟宗门/
├── Doc/ # 设计文档
│ ├── 修仙宗门设计文档.md
│ ├── 宗门行政体系.md
│ ├── 宗门礼仪建筑.md
│ └── 游戏模块总览.md
├── addons/ # Godot 插件
├── assets/ # 原始资源文件(导入前素材)
│ ├── sprites/ # 精灵图
│ │ ├── buildings/
│ │ ├── characters/
│ │ ├── icons/
│ │ └── ui/
│ ├── audio/ # 音频
│ │ ├── bgm/
│ │ └── sfx/
│ └── fonts/ # 字体
├── resources/ # Godot 资源文件 (.tres / .res)
│ ├── settings/ # 全局配置
│ ├── buildings/ # 建筑配置表
│ ├── characters/ # 角色模板
│ ├── skills/ # 功法/技能数据
│ ├── items/ # 物品/装备数据
│ └── events/ # 事件配置
├── src/ # 源码 + 场景(按功能模块组织)
│ │ # .tscn 和 .cs 放在一起)
│ │
│ ├── Core/ # 核心框架
│ │ ├── GameManager.cs # 游戏主循环
│ │ ├── GameManager.tscn
│ │ ├── TimeSystem.cs # 时间系统
│ │ ├── EventBus.cs # 事件总线
│ │ ├── SaveSystem.cs # 存档/读档
│ │ └── ConfigLoader.cs # 配置加载
│ │
│ ├── Data/ # 数据层
│ │ ├── Models/ # 数据模型(DTO)
│ │ └── SO/ # ScriptableObject 定义
│ │ ├── BuildingSO.cs
│ │ ├── SkillSO.cs
│ │ ├── DiscipleSO.cs
│ │ └── EventSO.cs
│ │
│ ├── Sect/ # 宗门管理
│ │ ├── SectManager.cs # 宗门主管理器
│ │ ├── PowerSystem.cs # 权力结构
│ │ ├── FinanceManager.cs # 财政经济
│ │ ├── DiplomacySystem.cs # 外交
│ │ ├── ContributionSystem.cs # 贡献系统
│ │ ├── buildings/ # 建筑系统
│ │ │ ├── BuildingSystem.cs
│ │ │ ├── BuildingBase.cs
│ │ │ ├── BuildingBase.tscn
│ │ │ └── buildings/ # 具体建筑(按分类子目录)
│ │ │ ├── admin/ # 行政类
│ │ │ ├── education/ # 教育类
│ │ │ ├── workshop/ # 工坊类
│ │ │ ├── storage/ # 物资类
│ │ │ ├── resource/ # 资源类
│ │ │ ├── living/ # 生活类
│ │ │ ├── ritual/ # 礼仪类
│ │ │ └── utility/ # 功能类
│ │ ├── halls/ # 各堂管理
│ │ │ ├── MissionHall.cs # 功德堂/任务堂
│ │ │ ├── TeachHall.cs # 传功堂
│ │ │ ├── LawHall.cs # 执法堂
│ │ │ └── ForeignHall.cs # 外事堂
│ │ └── panels/ # 宗门管理面板场景
│ │
│ ├── Character/ # 角色系统
│ │ ├── Disciple.cs # 弟子类
│ │ ├── Disciple.tscn # 弟子预制场景
│ │ ├── DiscipleGenerator.cs # 弟子生成器
│ │ ├── DisciplePool.cs # 弟子对象池
│ │ ├── Stats.cs # 属性系统
│ │ ├── CultivationSystem.cs # 境界/突破
│ │ ├── SkillSystem.cs # 功法/技能
│ │ ├── EquipmentSystem.cs # 装备系统
│ │ ├── RelationshipSystem.cs # 社交关系
│ │ └── AI/ # 弟子AI
│ │ ├── DiscipleAI.cs
│ │ └── BehaviorNodes.cs
│ │
│ ├── Production/ # 生产制造
│ │ ├── AlchemySystem.cs # 炼丹
│ │ ├── ForgeSystem.cs # 炼器
│ │ ├── TalismanSystem.cs # 符箓
│ │ ├── ArraySystem.cs # 阵法
│ │ ├── PuppetSystem.cs # 傀儡
│ │ ├── FarmingSystem.cs # 种植
│ │ └── BeastSystem.cs # 养殖
│ │
│ ├── Combat/ # 战斗系统
│ │ ├── BattleManager.cs # 战斗管理器
│ │ ├── BattleField.cs # 战场
│ │ ├── BattleField.tscn
│ │ ├── TurnController.cs # 回合控制
│ │ ├── DamageCalculator.cs # 伤害计算
│ │ ├── SkillEffect.cs # 技能效果
│ │ ├── TeamFormation.cs # 阵型
│ │ └── enemies/ # 敌方配置
│ │
│ ├── World/ # 世界/地图
│ │ ├── MapManager.cs # 地图管理器
│ │ ├── WorldMap.cs # 大地图
│ │ ├── WorldMap.tscn
│ │ ├── SectSite.cs # 宗门驻地
│ │ ├── SectSite.tscn
│ │ ├── ExplorationSystem.cs # 探索系统
│ │ ├── SecretRealm.cs # 秘境
│ │ └── MarketSystem.cs # 市场/交易
│ │
│ ├── Events/ # 事件/叙事
│ │ ├── EventManager.cs # 事件管理器
│ │ ├── RandomEvent.cs # 随机事件
│ │ ├── StorySystem.cs # 主线/支线
│ │ ├── TribulationSystem.cs # 天劫系统
│ │ └── SeasonEvent.cs # 赛季活动
│ │
│ ├── UI/ # 用户界面
│ │ ├── HUD/ # 主界面 HUD
│ │ ├── Panels/ # 功能面板
│ │ │ ├── SectPanel.cs # 宗门总览
│ │ │ ├── DisciplePanel.cs # 弟子列表/详情
│ │ │ ├── BuildingPanel.cs # 建筑详情
│ │ │ ├── FinancePanel.cs # 财政面板
│ │ │ └── EventDialog.cs # 事件弹窗
│ │ ├── Controls/ # 自定义控件
│ │ └── Common/ # 通用UI组件
│ │
│ └── Utils/ # 工具类
│ ├── MathUtils.cs
│ ├── RandomUtils.cs
│ ├── StringUtils.cs
│ └── Extensions.cs
├── icon.svg
└── project.godot
```
## 命名规范
| 类别 | 格式 | 示例 |
| -------- | ------------------ | ----------------------- |
| C# 类 | PascalCase | `SectManager.cs` |
| 场景文件 | PascalCase | `BuildingBase.tscn` |
| 资源文件 | snake_case | `iron_sword.tres` |
| 精灵图 | snake_case | `building_office.png` |
| 变量 | camelCase | `currentGold` |
| 私有变量 | _camelCase | `_discipleList` |
> **注意**C# 脚本的 `namespace` 使用 `项目名.模块名`,例如 `SectSim.Sect`、`SectSim.Character`。在 Godot 4 中,脚本路径决定了自动生成的默认命名空间,保持路径与命名空间一致可避免手动配置。