Commit 451a516c authored by Inge Wallin's avatar Inge Wallin

Revert "Don't emit a signal before all info is stored."

This reverts commit b58a3ea9.
parent c26a2eea
......@@ -37,8 +37,8 @@ KReversiGame::KReversiGame()
, m_computerColor(White)
{
// reset board
for (int r = 0; r < 8; ++r)
for(int c = 0; c < 8; ++c)
for(int r=0; r<8; ++r)
for(int c=0; c<8; ++c)
m_cells[r][c] = NoColor;
// initial pos
m_cells[3][3] = m_cells[4][4] = White;
......@@ -75,8 +75,6 @@ void KReversiGame::makePlayerMove(int row, int col, bool demoMode)
}
makeMove(move, changedChips);
m_undoStack.push(changedChips);
emit moveFinished();
}
void KReversiGame::startNextTurn(bool demoMode)
......@@ -131,8 +129,6 @@ void KReversiGame::makeComputerMove()
makeMove(move, changedChips);
m_undoStack.push(changedChips);
emit moveFinished();
}
int KReversiGame::undo()
......@@ -187,10 +183,8 @@ void KReversiGame::makeMove(const KReversiPos& move, PosList &changedChips)
changedChips.clear();
setChipColor(move.color, move.row, move.col);
// the first one is the move itself
changedChips.append(move);
// now turn color of all chips that were won
if (hasChunk(Up, move)) {
for (int r=move.row-1; r >= 0; --r) {
......@@ -259,6 +253,7 @@ void KReversiGame::makeMove(const KReversiPos& move, PosList &changedChips)
m_curPlayer = (m_curPlayer == White ? Black : White);
//kDebug() << "Current player changed to" << (m_curPlayer == White ? "White" : "Black");
emit moveFinished();
}
PosList KReversiGame::changedChips() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment