mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-06-29 00:45:55 +08:00
feat: 集成大模型AI、重构构建系统并修复多项代码质量问题
- 构建系统:Makefile 迁移至 CMakeLists.txt,支持 cJSON 和 WinHTTP - 项目结构:src/ 按功能拆分为 core/、gui/、network/、record/、llm/ 子目录 - 新功能:集成大模型 AI(WinHTTP + cJSON,兼容 OpenAI 协议),支持异步请求 - 渲染修复:IupDraw* 替换为 Windows GDI,修复画布黑屏问题 - 网络修复:ENet 初始化幂等化,实现真实 get_local_ip() (Winsock) - 代码质量:删除死代码 (dfs/count_threats_in_direction),修复头文件守卫, sprintf→snprintf 防溢出,strncpy 安全终止,GDI 资源泄漏修复 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -32,13 +32,6 @@ int evaluate_move(int x, int y);
|
||||
*/
|
||||
int evaluate_pos(int x, int y, int player);
|
||||
|
||||
/**
|
||||
* @brief 评估棋盘价值
|
||||
*
|
||||
* @param player 玩家标识(PLAYER/AI)
|
||||
*/
|
||||
int dfs(int x, int y, int player, int depth, int alpha, int beta, bool is_maximizing);
|
||||
|
||||
/**
|
||||
* @brief AI下棋
|
||||
*
|
||||
@@ -71,13 +64,5 @@ bool is_near_stones(int x, int y);
|
||||
*/
|
||||
ThreatLevel detect_threat(int x, int y, int player);
|
||||
|
||||
/**
|
||||
* @brief 计算指定方向的威胁数量
|
||||
* @param x, y 起始位置
|
||||
* @param dx, dy 方向向量
|
||||
* @param player 玩家
|
||||
* @return 威胁数量
|
||||
*/
|
||||
int count_threats_in_direction(int x, int y, int dx, int dy, int player);
|
||||
|
||||
#endif // AI_H
|
||||
Reference in New Issue
Block a user