<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/126788/">https://git.reviewboard.kde.org/r/126788/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDE Games.</div>
<div>By Julian Helfferich.</div>










<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kblocks
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Pause button is disabled when a game stops. Before, the pause button was disabled when it was pressed and no game was running. To achieve this, GameLogicInterface and SingleGameInterface (and therefore also KBlocksGameLogic and KBlocksSingleGame) were made QObjects. When a single game stops, the signal KBlocksSingleGame::gameStopped() is emitted. The signal is connected to KBlocksGameLogic::stopGame() which stops all games and emits the KBlocksGameLogic::allGamesStopped() signal. This signal is then connected to KBlocksWin::onAllGamesStopped() which disables the pause button.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Additionally, KBlocksWin::onAllGamesStopped() calles Kg::difficulty()->setGameRunning(false). This fixes another minor bug: When changing the difficulty after a game was finished, a warning appeared that changing the difficulty would stop the current game even though no game was running. Now, the warning appears only when a game is running.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I have created the files GameLogicInterface.cpp and SingleGameInterface.cpp and added them to the CMakesList.txt. Before, all definitions were in GameLogicInterface.h and SingleGameInterface.h, respectively. I created the cpp files so that they are included by automoc. Is there a better way to make automoc include GameLogicInterface and SingleGameInterface?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">The new signals provide the opportunity to improve the sometimes unintuitive structure of KBlocks. For example, KSingleGame stops when a new piece can not be placed. KBlocksScene, on the other hand stops when updateGame reads -1 removed lines. I will use the opportunity to extend the use of the gameStopped() signal as my next task.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I played the game:
1) Single player:
Started a new game after game stopped and while game was running, either once by clicking on "New Game" and by changing the difficulty.
2) Human vs. AI:
Loosing game, winning game, restarting game by clicking on "New Game" and by changing the difficulty.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>CMakeLists.txt <span style="color: grey">(105a251)</span></li>

 <li>GameLogicInterface.h <span style="color: grey">(eaf588a)</span></li>

 <li>GameLogicInterface.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>KBlocksGameLogic.h <span style="color: grey">(fec3658)</span></li>

 <li>KBlocksGameLogic.cpp <span style="color: grey">(e455405)</span></li>

 <li>KBlocksSingleGame.h <span style="color: grey">(8efff0f)</span></li>

 <li>KBlocksSingleGame.cpp <span style="color: grey">(76647d3)</span></li>

 <li>KBlocksWin.h <span style="color: grey">(9c1616c)</span></li>

 <li>KBlocksWin.cpp <span style="color: grey">(a9a2144)</span></li>

 <li>SingleGameInterface.h <span style="color: grey">(b9a9efe)</span></li>

 <li>SingleGameInterface.cpp <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/126788/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>



  </div>
 </body>
</html>