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

Method textStep

ChessBoard.cpp:1026–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024}
1025
1026QString ChessBoard::textStep(int id, int row, int col)
1027{
1028 int rowFrom= m_ChessPieces[id].m_nRow;
1029 int rowTo= row;
1030 int colFrom= m_ChessPieces[id].m_nCol;
1031 int colTo= col;
1032
1033 QString temp="";
1034 QString name=m_ChessPieces[id].getnName(m_ChessPieces[id].m_bRed);
1035 QString textCol= m_ChessPieces[id].getColText(colFrom);
1036 QString textRow= m_ChessPieces[id].getRowText(rowTo);
1037 temp.append(name).append(textCol).append(textRow);
1038
1039 //兵炮车将
1040 if(m_ChessPieces[id].m_emType==6 || m_ChessPieces[id].m_emType==5 || m_ChessPieces[id].m_emType==4 || m_ChessPieces[id].m_emType==0)
1041 {
1042 //行相等
1043 if(rowFrom== rowTo)
1044 {
1045 temp.append(m_ChessPieces[id].getColText(colTo));
1046 return temp;
1047 }
1048 //移动的格数
1049 temp.append(m_ChessPieces[id].getMoveText(rowFrom, rowTo));
1050 }
1051 else //马相士
1052 {
1053 //移动后所在列
1054 temp.append(m_ChessPieces[id].getColText(colTo));
1055 }
1056 return temp;
1057
1058}
1059
1060void ChessBoard::backOne()
1061{

Callers

nothing calls this directly

Calls 4

getnNameMethod · 0.80
getColTextMethod · 0.80
getRowTextMethod · 0.80
getMoveTextMethod · 0.80

Tested by

no test coverage detected