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

Method tryMoveStone

ChessBoard.cpp:979–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977}
978
979void ChessBoard::tryMoveStone(int killid, int row, int col)
980{
981 if (killid != -1 && sameColor(killid, m_nSelectID)) {
982 trySelectStone(killid);
983 return;
984 }
985
986 bool ret = canMove(m_nSelectID, killid, row, col);
987 if (ret) {
988 doMoveStone(m_nSelectID, killid, row, col);
989 m_nSelectID = -1;
990 update();
991 }
992}
993
994void ChessBoard::doMoveStone(int moveid, int killid, int row, int col)
995{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected