|
中国象棋控件 2.0.15
|
棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条 红棋在下,黑棋在上,左上角为[0][0],右下角为[9][10] 更多...
#include <ChessGame.h>
类 | |
| struct | strCODE |
| struct | strFile |
| struct | strFileHead |
| struct | strStartGame |
| 棋局结构 更多... | |
| struct | strStep |
Public 类型 | |
| enum | _SavePgnFormat { ICCS , Chinese , WXF } |
Public 成员函数 | |
| int | SaveStep (int i, int j, CPiece::ENUM_QiZi qz, const char *pDescript=nullptr, time_t tm=time(nullptr)) |
| 保存一步 | |
| int | RevokeStep () |
| 撤销一步 | |
| int | GetPreviouStep (int &i, int &j, CPiece::ENUM_QiZi &qz) |
| 函数名:GetPreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51 | |
| int | GetNextStep (int &i, int &j, CPiece::ENUM_QiZi &qz) |
| Gets the next step | |
| time_t | GetStartTime () |
| int | SetStartTime (const time_t &t) |
| time_t | GetEndTime () |
| int | SetEndTime (const time_t &t) |
| std::string | GetRedName () |
| int | SetRedName (const char *pszName) |
| std::string | GetBlackName () |
| int | SetBlackName (const char *pszName) |
| std::string | GetTag (const std::string &szpTag) |
| int | AddTag (const std::string &szTag, const std::string &szVal) |
| int | SaveChessGame (const char *pFileName) |
| Saves the chess game | |
| int | LoadChessGame (const char *pFileName) |
| int | SaveChessGamePgn (const char *pFileName, _SavePgnFormat f=Chinese) |
| int | LoadChessGamePgn (const char *pFileName, _SavePgnFormat f=Chinese) |
| int | GetStartGameBoard (CPiece::ENUM_QiZi board[][10]) |
| 得到开局棋盘布局 | |
静态 Public 成员函数 | |
| static int | CheckGame (const CPiece::ENUM_QiZi board[][10]) |
| 棋盘开局 检测布局是否合法, 使用标准棋盘布局,红下黑上 | |
Public 属性 | |
| std::vector< strStartGame > | m_StartGame |
Private 类型 | |
| enum | _ENUM_BianMa { BianMa , JieMa } |
| typedef enum CChessGame::_ENUM_BianMa | ENUM_BianMa |
Private 成员函数 | |
| int | QiZiBianMa (int *i, int *j, CPiece::ENUM_QiZi *qz, strCODE *pCode, ENUM_BianMa bianma=BianMa) |
| 棋子编解码 | |
| int | WriteStringToFile (std::ofstream &o, std::string &s) |
| int | ReadStringFromFile (std::ifstream &i, std::string &s) |
Private 属性 | |
| int | m_nIndex |
| bool | m_bFuPang |
| 走棋步数 | |
| std::vector< strStep > | m_ChessGame |
| 复盘标志 | |
| time_t | m_tmStart |
| 棋局 | |
| time_t | m_tmEnd |
| 开始时间 | |
| std::string | m_szRedName |
| 结束时间 | |
| std::string | m_szBlackName |
| 红方名 | |
| std::map< std::string, std::string > | m_Tags |
| 黑方名 | |
棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条 红棋在下,黑棋在上,左上角为[0][0],右下角为[9][10]
棋盘位置
行棋,红方先行:详见《象棋竞赛规则(2011)》第一章 第2条
在文件 ChessGame.h 第 41 行定义.
|
private |
在文件 ChessGame.h 第 140 行定义.
| enum CChessGame::_SavePgnFormat |
在文件 ChessGame.h 第 105 行定义.
| CChessGame::CChessGame | ( | ) |
在文件 ChessGame.cpp 第 19 行定义.
|
virtual |
在文件 ChessGame.cpp 第 65 行定义.
| int CChessGame::AddTag | ( | const std::string & | szTag, |
| const std::string & | szVal | ||
| ) |
在文件 ChessGame.cpp 第 513 行定义.
|
static |
棋盘开局 检测布局是否合法, 使用标准棋盘布局,红下黑上
在文件 ChessGame.cpp 第 520 行定义.
| std::string CChessGame::GetBlackName | ( | ) |
在文件 ChessGame.cpp 第 493 行定义.
| time_t CChessGame::GetEndTime | ( | ) |
在文件 ChessGame.cpp 第 471 行定义.
| int CChessGame::GetNextStep | ( | int & | i, |
| int & | j, | ||
| CPiece::ENUM_QiZi & | qz | ||
| ) |
Gets the next step
| int | i:当前下棋的位置,横坐标[0-8] | |
| int | j:当前下棋的位置,纵坐标[0-9] | |
| [in,out] | qz |
在文件 ChessGame.cpp 第 179 行定义.
| int CChessGame::GetPreviouStep | ( | int & | i, |
| int & | j, | ||
| CPiece::ENUM_QiZi & | qz | ||
| ) |
函数名:GetPreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51
在文件 ChessGame.cpp 第 158 行定义.
| std::string CChessGame::GetRedName | ( | ) |
在文件 ChessGame.cpp 第 482 行定义.
| int CChessGame::GetStartGameBoard | ( | CPiece::ENUM_QiZi | board[][10] | ) |
| time_t CChessGame::GetStartTime | ( | ) |
在文件 ChessGame.cpp 第 460 行定义.
| std::string CChessGame::GetTag | ( | const std::string & | szpTag | ) |
在文件 ChessGame.cpp 第 504 行定义.
| int CChessGame::LoadChessGame | ( | const char * | pFileName | ) |
在文件 ChessGame.cpp 第 268 行定义.
| int CChessGame::LoadChessGamePgn | ( | const char * | pFileName, |
| _SavePgnFormat | f = Chinese |
||
| ) |
在文件 ChessGame.cpp 第 417 行定义.
|
private |
棋子编解码
| i | 棋盘横坐标[0-8] |
| j | 棋盘纵坐标[0-9] |
| qz | 棋子 |
| pCode | 棋子编码 |
| bianma | 枚举常量(BianMa:编码(默认值),JieMa:解码) |
在文件 ChessGame.cpp 第 77 行定义.
|
private |
在文件 ChessGame.cpp 第 444 行定义.
| int CChessGame::RevokeStep | ( | ) |
| int CChessGame::SaveChessGame | ( | const char * | pFileName | ) |
Saves the chess game
| pFileName | Filename of the file. |
在文件 ChessGame.cpp 第 189 行定义.
| int CChessGame::SaveChessGamePgn | ( | const char * | pFileName, |
| _SavePgnFormat | f = Chinese |
||
| ) |
在文件 ChessGame.cpp 第 351 行定义.
| int CChessGame::SaveStep | ( | int | i, |
| int | j, | ||
| CPiece::ENUM_QiZi | qz, | ||
| const char * | pDescript = nullptr, |
||
| time_t | tm = time(nullptr) |
||
| ) |
保存一步
| char | i:当前下棋的位置,横坐标[0-8] |
| char | j:当前下棋的位置,纵坐标[0-9] |
| qz | 棋子 |
| const | char* pDescript: 这一步的描述 |
在文件 ChessGame.cpp 第 109 行定义.
| int CChessGame::SetBlackName | ( | const char * | pszName | ) |
在文件 ChessGame.cpp 第 498 行定义.
| int CChessGame::SetEndTime | ( | const time_t & | t | ) |
在文件 ChessGame.cpp 第 476 行定义.
| int CChessGame::SetRedName | ( | const char * | pszName | ) |
在文件 ChessGame.cpp 第 487 行定义.
| int CChessGame::SetStartTime | ( | const time_t & | t | ) |
在文件 ChessGame.cpp 第 465 行定义.
|
private |
在文件 ChessGame.cpp 第 432 行定义.
|
private |
走棋步数
在文件 ChessGame.h 第 150 行定义.
|
private |
复盘标志
在文件 ChessGame.h 第 151 行定义.
|
private |
在文件 ChessGame.h 第 149 行定义.
| std::vector<strStartGame> CChessGame::m_StartGame |
在文件 ChessGame.h 第 121 行定义.
|
private |
红方名
在文件 ChessGame.h 第 156 行定义.
|
private |
结束时间
在文件 ChessGame.h 第 155 行定义.
|
private |
黑方名
在文件 ChessGame.h 第 157 行定义.
|
private |
开始时间
在文件 ChessGame.h 第 154 行定义.
|
private |
棋局
在文件 ChessGame.h 第 153 行定义.