mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-05-09 18:09:46 +08:00
f897536a45
refactor(globals): 移除不必要的GUI运行状态标志 refactor(gui): 更新注释以反映使用IUP库 refactor(ai): 修改威胁检测逻辑以提升威胁等级 refactor(config): 修改加载和保存配置的时间限制逻辑 refactor(network): 更新默认网络端口常量 refactor(record): 移除冗余注释并增强复盘步骤的合法性检查
61 lines
1001 B
C
61 lines
1001 B
C
/**
|
|
* @file gui.h
|
|
* @brief 图形化用户界面头文件
|
|
* @note 使用IUP库实现五子棋的图形化界面
|
|
* @author 刘航宇
|
|
*/
|
|
|
|
#ifndef GUI_H
|
|
#define GUI_H
|
|
|
|
#include "gobang.h"
|
|
#include "config.h"
|
|
#include "globals.h"
|
|
|
|
// GUI函数声明
|
|
|
|
/**
|
|
* @brief 初始化GUI
|
|
* @details 初始化IUP图形库和游戏界面组件
|
|
* @return 成功返回0,失败返回-1
|
|
*/
|
|
int init_gui();
|
|
|
|
/**
|
|
* @brief 清理GUI资源
|
|
*/
|
|
void cleanup_gui();
|
|
|
|
/**
|
|
* @brief 屏幕坐标转棋盘坐标
|
|
*/
|
|
int screen_to_board(int screen_x, int screen_y, int *board_x, int *board_y);
|
|
|
|
/**
|
|
* @brief 显示消息
|
|
*/
|
|
void show_message(const char *message);
|
|
|
|
/**
|
|
* @brief 启动玩家对战模式
|
|
*/
|
|
void start_pvp_game_gui();
|
|
|
|
/**
|
|
* @brief 启动人机对战模式
|
|
*/
|
|
void start_pve_game_gui();
|
|
|
|
/**
|
|
* @brief 启动复盘模式
|
|
*/
|
|
void start_replay_gui();
|
|
|
|
/**
|
|
* @brief 运行图形化界面模式
|
|
* @details 主循环处理事件、渲染画面和更新状态
|
|
*/
|
|
void run_gui_mode();
|
|
|
|
#endif // GUI_H
|