* @brief 获取棋子所在行 返回文本棋谱 * @param rowTo * @return QString */
| 132 | * @return QString |
| 133 | */ |
| 134 | QString ChessPieces::getRowText(int rowTo) |
| 135 | { |
| 136 | QString temp=""; |
| 137 | if(m_nRow== rowTo) |
| 138 | { |
| 139 | temp.append("平"); |
| 140 | return temp; |
| 141 | } |
| 142 | if(m_nRow> rowTo) |
| 143 | { |
| 144 | if(m_bRed){ |
| 145 | temp.append("进"); |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | temp.append("退"); |
| 150 | } |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | if(m_bRed){ |
| 155 | temp.append("退"); |
| 156 | } |
| 157 | else |
| 158 | { |
| 159 | temp.append("进"); |
| 160 | } |
| 161 | } |
| 162 | return temp; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @brief 获取棋子移动的格数 返回文本棋谱 |