[Kde-games-devel] kmines pause action

Dmitry Suzdalev dimsuzkde at gmail.com
Wed Apr 16 22:08:12 CEST 2008


On Wednesday 16 April 2008 23:28:06 Mauricio Piacentini wrote:
> GnuShi wrote:
> > I've tried to come close to the mixed coding standard. ;-) Maybe its
> > time for a written-down kde-games standard.
> >
> > If there are more issues with the patch, please feel free to tell me.
>
> Tested here, looks good from me. Maybe we could improve it a bit in the
> future (with a permanent indication of the paused status), but it is
> clear so far I think. Do you want me to commit it, or are you going to
> do it?
Wait, i've some minor notes :)

First:

+    /**
+     * true, if we paused the game.
+     */
+    void gamePaused(bool);

Bad name, bad comment :)
By looking at this name I imagine that this is some getter-function which 
tells us if the game is paused. Comment is not very informative too.
I suggest something like this:

/*
* Toggles paused state for all cells in the field item
*/
void setGamePaused(bool paused);

This needs to be done for both gamePaused - in scene.* and in minefielditem.*

Second:
I'm not sure if changing all cells to questions is the best way to behave on 
pause :)
Perhaps hiding the MineFieldItem & showing popup (which is already done) until 
game is unpaused is better? What do you think?
(me and piacentini are liking hiding solution more - discussed on irc)
Ah, and popup shouldn't close even if clicked.
This is not possible with the current KGamePopup API (popup *always* hides on 
click), I'll add this possibility in a moment ;).

Anyway, even if you vote for questions-on-every-cell, I think that cell should 
know nothing about game state (i.e. if game's paused or not) and it seems not 
needed for *each and every* cell to hold the *same* state :)
It's the MineFieldItem who should know this state and setup cells accordingly. 
But this might need some further adjustments to code. If we deside to go 
questions-route, I may come up with actual code :)

That's all of my notes :)
Now i'm waiting for yours ;)
Thanks for the patch!

Cheers,
Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20080417/e694a82f/attachment-0001.html 


More information about the kde-games-devel mailing list