本文整理汇总了C++中Coords::isStartMove方法的典型用法代码示例。如果您正苦于以下问题:C++ Coords::isStartMove方法的具体用法?C++ Coords::isStartMove怎么用?C++ Coords::isStartMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coords
的用法示例。
在下文中一共展示了Coords::isStartMove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: playMoves
/**
* Play moves on move at a time
*/
void Board::playMoves() {
std::list<Coords>::const_iterator iterator;
bool allMovesGood = true;
for (iterator = moves.begin(); iterator != moves.end(); ++iterator) {
Coords move = *iterator;
if (legalCoord(move)) {
if (move.isStartMove()) {
cmatrix[move.m_y][move.m_x].m_pointType = PointType::Start;
currentMove = move;
printBoardBasic();
continue;
} else if (move.isEndMove()) {
cmatrix[move.m_y][move.m_x].m_pointType = PointType::End;
} else {
cmatrix[move.m_y][move.m_x].m_pointType = PointType::Normal;
}
if (!isValidMove(currentMove, move)) {
allMovesGood = false;
cout << "Move " << move << " is invalid" << endl;
} else {
cout << "Move " << move << " is valid" << endl;
}
currentMove = move;
printBoardBasic();
} else {
allMovesGood = false;
cout << "Move " << move << " is invalid" << endl;
}
}
if (allMovesGood) {
cout << "Summary: All moves are valid" << endl;
} else {
cout << "Summary: There are some invalid moves in the sequence" << endl;
}
}