A startup for it

This commit is contained in:
2025-11-22 22:16:58 +08:00
parent 6703ebfcd2
commit 5100aa799f
15 changed files with 238 additions and 49 deletions

View File

@@ -10,3 +10,41 @@ cd build
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..
ninja
```
## 项目结构
```bash
ChessGame/
├── src/
│ ├── core/ # 核心游戏逻辑
│ │ ├── Game.h/cpp # 游戏主循环和状态管理
│ │ ├── Board.h/cpp # 棋盘逻辑和规则实现
│ │ ├── Piece.h/cpp # 棋子基类和具体棋子实现
│ │ └── Rules.h/cpp # 游戏规则验证
│ ├── ai/ # 人工智能模块
│ │ ├── AIBase.h/cpp
│ │ ├── MinimaxAI.h/cpp
│ │ └── Heuristics.h/cpp
│ ├── network/ # 网络模块
│ │ ├── NetworkManager.h/cpp
│ │ ├── Protocol.h/cpp
│ │ └── Server.h/cpp
│ ├── ui/ # 用户界面
│ │ ├── Renderer.h/cpp # 渲染器(SDL3)
│ │ ├── UIComponents.h/cpp
│ │ └── MenuSystem.h/cpp
│ ├── input/ # ← 新增:输入处理模块(键盘、鼠标等)
│ │ ├── InputManager.h/cpp
│ ├── utils/ # 工具类
│ │ ├── Logger.h/cpp
│ │ ├── Config.h/cpp
│ │ └── Utils.h/cpp
│ └── main.cpp # 程序入口(使用 SDL3 回调)
├── assets/ # 资源文件
│ ├── images/
│ ├── fonts/
│ └── sounds/
├── config/ # 配置文件(如 game.ini
└── build/ # 构建输出目录(.gitignore 掉)
```
## 一些想说的
这是我第一次用cpp写的项目想写个比较完整的出来但是遇到了一堆问题只能说`路漫漫其修远兮,吾将上下而求索`,如果你有好的建议也是可以提出来的