mirror of
https://github.com/LHY0125/Gobang-Game.git
synced 2026-05-10 02:19:46 +08:00
dd2b6fd903
- 移除控制台版本相关代码,包括game_mode、ui、init_board等模块 - 将empty_board函数移至gobang.c核心模块 - 简化main.c仅保留GUI启动逻辑 - 更新Makefile仅构建GUI版本 - 清理过时文档和配置文件 - 优化GUI菜单和游戏窗口交互逻辑 - 添加AI难度配置支持
39 lines
1017 B
C
39 lines
1017 B
C
/**
|
|
* @file record.h
|
|
* @brief 游戏复盘与记录头文件
|
|
* @note 本文件定义了游戏复盘与记录相关的函数和数据结构。
|
|
* 它负责管理游戏的历史记录、加载和保存游戏文件、计算游戏评分等功能。
|
|
*/
|
|
#ifndef RECORD_H
|
|
#define RECORD_H
|
|
|
|
#include "gobang.h"
|
|
|
|
// --- 复盘与记录功能 ---
|
|
/**
|
|
* @brief 将当前对局记录保存到文件
|
|
* @param filename 要保存到的文件名
|
|
* @param game_mode 游戏模式
|
|
* @return 0表示成功,非0表示失败
|
|
*/
|
|
int save_game_to_file(const char *filename, int game_mode);
|
|
|
|
/**
|
|
* @brief 从文件加载游戏记录
|
|
* @param filename 要加载的文件名
|
|
* @return 游戏模式(1或2),0表示失败
|
|
*/
|
|
int load_game_from_file(const char *filename);
|
|
|
|
/**
|
|
* @brief 计算游戏评分
|
|
*/
|
|
void calculate_game_scores();
|
|
|
|
/**
|
|
* @brief 显示游戏评分结果和MVP评选
|
|
* @param game_mode 游戏模式(1-人机对战,2-双人对战)
|
|
*/
|
|
void display_game_scores(int game_mode);
|
|
|
|
#endif // RECORD_H
|