中国象棋控件 v2.0.13
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 所有成员列表
CChessGame类 参考

棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(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< strStartGamem_StartGame
 

详细描述

棋局类 完成棋局的加载、保存、复盘等对棋局的操作 注意:棋盘布局:详见《象棋竞赛规则(2011)》第一章 第1条 红棋在下,黑棋在上,左上角为[0][0],右下角为[9][10]

棋盘位置

[0][0] ------------------> i 或 x 方向
|
|
|
| [i][j]
|
|
\|/ [9][10]
|
j 或 y 方向

行棋,红方先行:详见《象棋竞赛规则(2011)》第一章 第2条

作者
康林 kl222.nosp@m.@126.nosp@m..com
日期
2020/5/17

在文件 ChessGame.h40 行定义.

成员枚举类型说明

◆ _SavePgnFormat

enum CChessGame::_SavePgnFormat

在文件 ChessGame.h104 行定义.

构造及析构函数说明

◆ CChessGame()

CChessGame::CChessGame ( )

在文件 ChessGame.cpp19 行定义.

◆ ~CChessGame()

CChessGame::~CChessGame ( )
virtual

在文件 ChessGame.cpp65 行定义.

成员函数说明

◆ AddTag()

int CChessGame::AddTag ( const std::string &  szTag,
const std::string &  szVal 
)

在文件 ChessGame.cpp519 行定义.

◆ CheckGame()

int CChessGame::CheckGame ( const CPiece::ENUM_QiZi  board[][10])
static

检测布局是否合法, 使用标准棋盘布局,红下黑上

在文件 ChessGame.cpp526 行定义.

◆ GetBlackName()

std::string CChessGame::GetBlackName ( )

在文件 ChessGame.cpp499 行定义.

◆ GetEndTime()

time_t CChessGame::GetEndTime ( )

在文件 ChessGame.cpp477 行定义.

◆ GetNextStep()

int CChessGame::GetNextStep ( int &  i,
int &  j,
CPiece::ENUM_QiZi &  qz 
)

Gets the next step

作者
KangLin(kl222.nosp@m.@126.nosp@m..com)
日期
2020/5/17
参数
inti:当前下棋的位置,横坐标[0-8]
intj:当前下棋的位置,纵坐标[0-9]
[in,out]qz
返回
The next step.

在文件 ChessGame.cpp185 行定义.

◆ GetPreviouStep()

int CChessGame::GetPreviouStep ( int &  i,
int &  j,
CPiece::ENUM_QiZi &  qz 
)

函数名:GetPreviouStep 功 能:上步棋 参 数:无 返回值:走棋步数 作 者:康 林 版 本:1.0.0.1 日 期:2004-10-5 时 间:10:19:51

在文件 ChessGame.cpp164 行定义.

◆ GetRedName()

std::string CChessGame::GetRedName ( )

在文件 ChessGame.cpp488 行定义.

◆ GetStartGameBoard()

int CChessGame::GetStartGameBoard ( CPiece::ENUM_QiZi  board[][10])

得到开局棋盘布局

参数
board返回开局棋盘布局
返回
成功,返回0,失败,返回非0

在文件 ChessGame.cpp638 行定义.

◆ GetStartTime()

time_t CChessGame::GetStartTime ( )

在文件 ChessGame.cpp466 行定义.

◆ GetTag()

std::string CChessGame::GetTag ( const std::string &  szpTag)

在文件 ChessGame.cpp510 行定义.

◆ LoadChessGame()

int CChessGame::LoadChessGame ( const char *  pFileName)

在文件 ChessGame.cpp274 行定义.

◆ LoadChessGamePgn()

int CChessGame::LoadChessGamePgn ( const char *  pFileName,
_SavePgnFormat  f = Chinese 
)

在文件 ChessGame.cpp423 行定义.

◆ RevokeStep()

int CChessGame::RevokeStep ( )

撤销一步

作者
KangLin(kl222.nosp@m.@126.nosp@m..com)
日期
2020/5/17
返回
成功返回 0 ,否则返回非零

在文件 ChessGame.cpp145 行定义.

◆ SaveChessGame()

int CChessGame::SaveChessGame ( const char *  pFileName)

Saves the chess game

作者
KangLin(kl222.nosp@m.@126.nosp@m..com)
日期
2020/5/19
参数
pFileNameFilename of the file.
返回
An int.

在文件 ChessGame.cpp195 行定义.

◆ SaveChessGamePgn()

int CChessGame::SaveChessGamePgn ( const char *  pFileName,
_SavePgnFormat  f = Chinese 
)

在文件 ChessGame.cpp357 行定义.

◆ SaveStep()

int CChessGame::SaveStep ( int  i,
int  j,
CPiece::ENUM_QiZi  qz,
const char *  pDescript = nullptr,
time_t  tm = time(nullptr) 
)

保存一步

作者
KangLin(kl222.nosp@m.@126.nosp@m..com)
日期
2020/5/17
参数
chari:当前下棋的位置,横坐标[0-8]
charj:当前下棋的位置,纵坐标[0-9]
qz棋子
constchar* pDescript: 这一步的描述
返回
成功返回 0 ,否则返回非零

在文件 ChessGame.cpp115 行定义.

◆ SetBlackName()

int CChessGame::SetBlackName ( const char *  pszName)

在文件 ChessGame.cpp504 行定义.

◆ SetEndTime()

int CChessGame::SetEndTime ( const time_t &  t)

在文件 ChessGame.cpp482 行定义.

◆ SetRedName()

int CChessGame::SetRedName ( const char *  pszName)

在文件 ChessGame.cpp493 行定义.

◆ SetStartTime()

int CChessGame::SetStartTime ( const time_t &  t)

在文件 ChessGame.cpp471 行定义.

类成员变量说明

◆ m_StartGame

std::vector<strStartGame> CChessGame::m_StartGame

在文件 ChessGame.h120 行定义.


该类的文档由以下文件生成: