Commit d467b15ee08e009c9db357a4a9c944c0cb27a79f

Authored by Hakeem
1 parent 505e594e

human player done without the end game tho

Showing 2 changed files with 12 additions and 2 deletions   Show diff stats
CMakeLists.txt.user
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3   -<!-- Written by QtCreator 4.7.0, 2018-09-19T08:36:15. -->
  3 +<!-- Written by QtCreator 4.7.0, 2018-09-19T15:34:16. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>EnvironmentId</variable>
... ...
guiapplication.cpp
... ... @@ -51,7 +51,17 @@ GuiApplication::GuiApplication(int&amp; argc, char** argv)
51 51  
52 52 void GuiApplication::startNextTurn()
53 53 {
  54 + m_model.update();/*
  55 + m_game_engine.switchCurrentPlayerId();*/
  56 +}
  57 +
  58 +void GuiApplication::boardClicked(int pos)
  59 +{
  60 + auto success = m_game_engine.performMoveForCurrentHuman(othello::BitPos{pos});
  61 + if (!success)
  62 + return;
54 63  
  64 + emit enqueueNextTurn();
55 65 }
56 66  
57 67 void GuiApplication::initNewHumanGame()
... ... @@ -59,7 +69,7 @@ void GuiApplication::initNewHumanGame()
59 69 m_game_engine.initPlayerType<othello::HumanPlayer, othello::PlayerId::One>();
60 70 m_game_engine.initPlayerType<othello::HumanPlayer, othello::PlayerId::Two>();
61 71 m_game_engine.initNewGame();
62   - m_model.update();
  72 + //m_model.update();
63 73 emit enqueueNextTurn();
64 74 }
65 75  
... ...