//收回棋子 bool board::retract(CHESS_COLOR color, int x, int y) { if (m_network[x][y][0].m_pioneer == NULL)return 0; limit_retract(color, x, y); // 在棋局链表中删除结点 for (int i = 0; i < 4; i++) { m_network[x][y][i].m_pioneer->m_next = m_network[x][y][i].m_next; if (!(m_network[x][y][i].m_next == NULL)) m_network[x][y][i].m_next->m_pioneer = m_network[x][y][i].m_pioneer; m_network[x][y][i].setZero(); } return 1; }
//收回棋子 bool board::retract(int color, int x, int y) { if (m_network[x][y][0].m_pioneer == NULL)return 0; limit_retract(color, x, y); // 在棋局链表中删除结点 for (int i = 0; i < 4; i++) { if (m_network[x][y][i].m_pioneer == NULL) { //cout << "retract error ::为什么前驱结点是空???" << endl; } m_network[x][y][i].m_pioneer->m_next = m_network[x][y][i].m_next; if (!(m_network[x][y][i].m_next == NULL)) m_network[x][y][i].m_next->m_pioneer = m_network[x][y][i].m_pioneer; m_network[x][y][i].setZero(); } return 1; }