判断某格子是否有棋子在其上
| 466 | |
| 467 | // 判断某格子是否有棋子在其上 |
| 468 | bool 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 | // 胜负已分,重置 |
| 482 | void ChessBoard::reset() |
nothing calls this directly
no outgoing calls
no test coverage detected