MCPcopy Create free account
hub / github.com/XMuli/ChineseChess / havePieces

Method havePieces

ChessBoard.cpp:468–479  ·  view source on GitHub ↗

判断某格子是否有棋子在其上

Source from the content-addressed store, hash-verified

466
467// 判断某格子是否有棋子在其上
468bool ChessBoard::havePieces(int row, int col)
469{
470 for (auto pieces : m_ChessPieces) {
471 if (pieces.m_bDead)
472 continue;
473
474 if (pieces.m_nRow == row && pieces.m_nCol == col)
475 return true;
476 }
477
478 return false;
479}
480
481// 胜负已分,重置
482void ChessBoard::reset()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected