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

Method canMoveSHI

ChessBoard.cpp:790–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790bool ChessBoard::canMoveSHI(int moveId, int killId, int row, int col)
791{
792 Q_UNUSED(killId);
793 if(isRed(moveId)) //红 士
794 {
795 if(row < 7 || col < 3 || col > 5) return false;
796 }
797 else //黑 士
798 {
799 if(row > 2 || col < 3 || col > 5) return false;
800 }
801
802 int d=relation(m_ChessPieces[moveId].m_nRow, m_ChessPieces[moveId].m_nCol, row, col);
803 if(d == 11)
804 return true;
805
806 return false;
807}
808
809bool ChessBoard::canMoveXIANG(int moveId, int killId, int row, int col)
810{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected