Commit b2f1b076 authored by Denis Kuplyakov's avatar Denis Kuplyakov

Fixed undo functional

It SEEMS to that I fixed undo function, but it still need to be tested
more. Need to add control that prevent human to undo when computer is
moving.
parent c2fde8d1
......@@ -159,6 +159,7 @@ int KReversiGame::undo()
m_changedChips.clear();
emit boardChanged();
kickCurrentPlayer();
return movesUndone;
}
......
......@@ -254,6 +254,8 @@ void KReversiMainWindow::slotNewGame()
void KReversiMainWindow::slotGameOver()
{
m_hintAct->setEnabled(false);
//TODO: only if it is not computer-computer match
m_undoAct->setEnabled(true);
// if (m_view->isInDemoMode()) {
......@@ -295,8 +297,8 @@ void KReversiMainWindow::slotGameOver()
void KReversiMainWindow::slotMoveFinished()
{
// if (!m_demoAct->isChecked())
// m_undoAct->setEnabled(m_game->canUndo());
//TODO check computer-computer
m_undoAct->setEnabled(m_game->canUndo());
// add last move to history list
// KReversiMove move = m_game->getLastMove();
......
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