[Kde-games-devel] Review Request 112676: refactor player selection

Alexander Schuch aschuch247 at gmail.com
Tue Oct 8 01:03:57 UTC 2013



> On Oct. 7, 2013, 10:02 p.m., Albert Astals Cid wrote:
> > Nemanja, if it looks good for you, i guess commiting it is fine (you or I do it, Alexander has no commiter rights), there's not much people around with knowledge about the code.
> > 
> > I'll add some silly minor comments about style, Alexander feel free to ignore it and I'll just fix it on commit (if it's me doing the commit), i'm just adding them so you see them.

I consider style as important. So thank you very much for your comments. This will just improve me on KDE/Qt hacking. :)


> On Oct. 7, 2013, 10:02 p.m., Albert Astals Cid wrote:
> > dialogs/newgamedlg.cc, line 380
> > <http://git.reviewboard.kde.org/r/112676/diff/2/?file=193309#file193309line380>
> >
> >     qDeleteAll(m_selectablePlayer);

Where does this magic come from? The code I used is given in the Qt documentation at https://qt-project.org/doc/qt-4.8/qlist.html#details. A qDeleteAll() does not seem to be part of Qt 4.8. It is something from KDE? Oh, okay. I found it over there at http://qt-project.org/doc/qt-4.8/qtalgorithms.html#qDeleteAll.


> On Oct. 7, 2013, 10:02 p.m., Albert Astals Cid wrote:
> > dialogs/newgamedlg.cc, line 479
> > <http://git.reviewboard.kde.org/r/112676/diff/2/?file=193309#file193309line479>
> >
> >     Just kill it if not used?

I like to keep it in order to add sanity checks. A game of all spectators (other patch) should not be allowed, a game full of AI should (one round tournament mode). Right now I am just not yet into this signal/slot thing to be able to revive this. Maybe you can help?


> On Oct. 7, 2013, 10:02 p.m., Albert Astals Cid wrote:
> > players/ai/default/default.h, line 2
> > <http://git.reviewboard.kde.org/r/112676/diff/2/?file=193310#file193310line2>
> >
> >     Added here, but question is for all the "new" files. Is this moved code or mostly new? If it's yours you should put your name isntead of Pierre's (and the correct year)

The weak.h, normal.h and hard.h basically are just wrappers for already present code. So I kept the author there. For the new *_gui classes, I added my own name and correct year already.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/112676/#review41368
-----------------------------------------------------------


On Oct. 8, 2013, 1:03 a.m., Alexander Schuch wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/112676/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2013, 1:03 a.m.)
> 
> 
> Review request for KDE Games.
> 
> 
> Repository: konquest
> 
> 
> Description
> -------
> 
> The default AI is handled by players/ai/default/default.cpp. The difficulty is wrapped in own classes so that the external interface is the same for all players (AI and human).
> 
> Adding new AI players is as easy as to implement the code in an own class, add a GUI wrapper (see ai/example) and add the GUI wrapper to m_selectablePlayer in NewGameDlg constructor.
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 0e8a354 
>   dialogs/newgamedlg.h 10ce4ee 
>   dialogs/newgamedlg.cc be764f1 
>   players/ai/default/default.h PRE-CREATION 
>   players/ai/default/default.cpp PRE-CREATION 
>   players/ai/default/hard.h PRE-CREATION 
>   players/ai/default/hard.cpp PRE-CREATION 
>   players/ai/default/hard_gui.h PRE-CREATION 
>   players/ai/default/hard_gui.cpp PRE-CREATION 
>   players/ai/default/normal.h PRE-CREATION 
>   players/ai/default/normal.cpp PRE-CREATION 
>   players/ai/default/normal_gui.h PRE-CREATION 
>   players/ai/default/normal_gui.cpp PRE-CREATION 
>   players/ai/default/weak.h PRE-CREATION 
>   players/ai/default/weak.cpp PRE-CREATION 
>   players/ai/default/weak_gui.h PRE-CREATION 
>   players/ai/default/weak_gui.cpp PRE-CREATION 
>   players/ai/example/example.h PRE-CREATION 
>   players/ai/example/example.cpp PRE-CREATION 
>   players/ai/example/example_gui.h PRE-CREATION 
>   players/ai/example/example_gui.cpp PRE-CREATION 
>   players/computerplayer.h ec25217 
>   players/computerplayer.cpp 2df7dd8 
>   players/localplayer_gui.h PRE-CREATION 
>   players/localplayer_gui.cpp PRE-CREATION 
>   players/player.h be0133a 
>   players/player_gui.h PRE-CREATION 
>   players/player_gui.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/112676/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alexander Schuch
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20131008/074ea780/attachment.html>


More information about the kde-games-devel mailing list