| 43 | } |
| 44 | |
| 45 | void MachineGame::getAllMoves(QVector<ChessStep *> &steps, bool forRed) |
| 46 | { |
| 47 | int start = forRed ? 16 : 0; |
| 48 | int end = forRed ? 32 : 16; |
| 49 | |
| 50 | for (int id = start; id < end; id++) { |
| 51 | if (m_ChessPieces[id].m_bDead) |
| 52 | continue; |
| 53 | |
| 54 | for (int row = 0; row < 10; row++) { |
| 55 | for (int col = 0; col < 9; col++) { |
| 56 | int targetId = getStoneId(row, col); |
| 57 | if (targetId != -1 && sameColor(id, targetId)) |
| 58 | continue; |
| 59 | int killId = (targetId != -1) ? targetId : -1; |
| 60 | if (canMove(id, killId, row, col)) |
| 61 | saveStep(id, killId, row, col, steps); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | void MachineGame::mouseReleaseEvent(QMouseEvent *ev) |
| 68 | { |
nothing calls this directly
no outgoing calls
no test coverage detected