|
中国象棋控件 v2.0.13
|
棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条 红棋在下,黑棋在上,左上角为[0][0],右下角为[9][10] 更多...
#include <ChessGame.h>
类 | |
| struct | strFile |
| struct | strFileHead |
| struct | strStartGame |
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 |
棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条 红棋在下,黑棋在上,左上角为[0][0],右下角为[9][10]
棋盘位置
行棋,红方先行:详见《象棋竞赛规则(2011)》第一章 第2条
在文件 ChessGame.h 第 40 行定义.
| enum CChessGame::_SavePgnFormat |
在文件 ChessGame.h 第 104 行定义.
| CChessGame::CChessGame | ( | ) |
在文件 ChessGame.cpp 第 19 行定义.
|
virtual |
在文件 ChessGame.cpp 第 65 行定义.
| int CChessGame::AddTag | ( | const std::string & | szTag, |
| const std::string & | szVal | ||
| ) |
在文件 ChessGame.cpp 第 519 行定义.
|
static |
检测布局是否合法, 使用标准棋盘布局,红下黑上
在文件 ChessGame.cpp 第 526 行定义.
| std::string CChessGame::GetBlackName | ( | ) |
在文件 ChessGame.cpp 第 499 行定义.
| time_t CChessGame::GetEndTime | ( | ) |
在文件 ChessGame.cpp 第 477 行定义.
| 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 第 185 行定义.
| int CChessGame::GetPreviouStep | ( | int & | i, |
| int & | j, | ||
| CPiece::ENUM_QiZi & | qz | ||
| ) |
函数名:GetPreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51
在文件 ChessGame.cpp 第 164 行定义.
| std::string CChessGame::GetRedName | ( | ) |
在文件 ChessGame.cpp 第 488 行定义.
| int CChessGame::GetStartGameBoard | ( | CPiece::ENUM_QiZi | board[][10] | ) |
| time_t CChessGame::GetStartTime | ( | ) |
在文件 ChessGame.cpp 第 466 行定义.
| std::string CChessGame::GetTag | ( | const std::string & | szpTag | ) |
在文件 ChessGame.cpp 第 510 行定义.
| int CChessGame::LoadChessGame | ( | const char * | pFileName | ) |
在文件 ChessGame.cpp 第 274 行定义.
| int CChessGame::LoadChessGamePgn | ( | const char * | pFileName, |
| _SavePgnFormat | f = Chinese |
||
| ) |
在文件 ChessGame.cpp 第 423 行定义.
| int CChessGame::RevokeStep | ( | ) |
| int CChessGame::SaveChessGame | ( | const char * | pFileName | ) |
Saves the chess game
| pFileName | Filename of the file. |
在文件 ChessGame.cpp 第 195 行定义.
| int CChessGame::SaveChessGamePgn | ( | const char * | pFileName, |
| _SavePgnFormat | f = Chinese |
||
| ) |
在文件 ChessGame.cpp 第 357 行定义.
| 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 第 115 行定义.
| int CChessGame::SetBlackName | ( | const char * | pszName | ) |
在文件 ChessGame.cpp 第 504 行定义.
| int CChessGame::SetEndTime | ( | const time_t & | t | ) |
在文件 ChessGame.cpp 第 482 行定义.
| int CChessGame::SetRedName | ( | const char * | pszName | ) |
在文件 ChessGame.cpp 第 493 行定义.
| int CChessGame::SetStartTime | ( | const time_t & | t | ) |
在文件 ChessGame.cpp 第 471 行定义.
| std::vector<strStartGame> CChessGame::m_StartGame |
在文件 ChessGame.h 第 120 行定义.