本文整理汇总了C++中Chess::getRow方法的典型用法代码示例。如果您正苦于以下问题:C++ Chess::getRow方法的具体用法?C++ Chess::getRow怎么用?C++ Chess::getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chess
的用法示例。
在下文中一共展示了Chess::getRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: judgeVictory
//每当落子后,判断胜负
bool ChessBoard::judgeVictory(Chess& lastchess)
{
int row = lastchess.getRow();
int column = lastchess.getColumn();
int type = lastchess.getChessType();
//垂直方向
if(fiveInDirection(row, column, type, VERTICAL))
{
return VICTORY;
}
//水平方向
if(fiveInDirection(row, column, type, HORIZON))
{
return VICTORY;
}
//右斜方向
if(fiveInDirection(row, column, type, RIGHT))
{
return VICTORY;
}
//左斜方向
if(fiveInDirection(row, column, type, LEFT))
{
return VICTORY;
}
return CONTINUE;
}
示例2: setOneChess
//指定一个棋子
void ChessBoard::setOneChess(Chess chess)
{
int row = chess.getRow();
int column = chess.getColumn();
this->chessboardmat[row][column] = chess.getChessType();
steps.push_back(chess);
}
示例3: backStep
//悔棋
bool ChessBoard::backStep()
{
if(steps.size() < 2)
{
return false;
}
for(int i = 0; i < 2; i++)
{
vector<Chess>::iterator it = steps.end() - 1;
Chess chess = *it;
int row = chess.getRow();
int column = chess.getColumn();
this->chessboardmat[row][column] = EMPTY_CHESS;
steps.pop_back();
}
return true;
}