[Kde-games-devel] Review Request 126788: Disable pause button when game stops

Julian Helfferich julian.helfferich at googlemail.com
Wed Jan 27 02:57:58 UTC 2016



> On Jan. 26, 2016, 9:25 p.m., Frederik Schwarzer wrote:
> > I do not understand all this interfacing stuff, so I cannot give you a "ship it" but if you want a review, I can give you some minor nitpicking. :)

Thank you very much for your comments. They are highly appreciated.


> On Jan. 26, 2016, 9:25 p.m., Frederik Schwarzer wrote:
> > SingleGameInterface.h, line 25
> > <https://git.reviewboard.kde.org/r/126788/diff/1/?file=433867#file433867line25>
> >
> >     Just out of curiosity: why? :D
> >     I am not an experienced programmer, so if you are willing to, I would like to know the difference here.
> >     Thanks.

I have moved the (trivial) function definitions to a separate .cpp file and added it to CMakesList.txt. I did this so that the classes would be included by automoc. Otherwise, the linker complains.


> On Jan. 26, 2016, 9:25 p.m., Frederik Schwarzer wrote:
> > SingleGameInterface.cpp, line 3
> > <https://git.reviewboard.kde.org/r/126788/diff/1/?file=433868#file433868line3>
> >
> >     Why don't you put yourself in Copyright? You wrote this.

Honestly, I just moved the function definitions from the .h to the .cpp file. But fair enough, I added myself. Is there a good rule of thumb when to add yourself to the copyright?


- Julian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126788/#review91630
-----------------------------------------------------------


On Jan. 18, 2016, 1:57 a.m., Julian Helfferich wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126788/
> -----------------------------------------------------------
> 
> (Updated Jan. 18, 2016, 1:57 a.m.)
> 
> 
> Review request for KDE Games.
> 
> 
> Repository: kblocks
> 
> 
> Description
> -------
> 
> 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.
> 
> 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.
> 
> 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?
> 
> 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.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 105a251 
>   GameLogicInterface.h eaf588a 
>   GameLogicInterface.cpp PRE-CREATION 
>   KBlocksGameLogic.h fec3658 
>   KBlocksGameLogic.cpp e455405 
>   KBlocksSingleGame.h 8efff0f 
>   KBlocksSingleGame.cpp 76647d3 
>   KBlocksWin.h 9c1616c 
>   KBlocksWin.cpp a9a2144 
>   SingleGameInterface.h b9a9efe 
>   SingleGameInterface.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/126788/diff/
> 
> 
> Testing
> -------
> 
> 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.
> 
> 
> Thanks,
> 
> Julian Helfferich
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20160127/14a8dd76/attachment.html>


More information about the kde-games-devel mailing list