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

Nemanja Hirsl nemhirsl at gmail.com
Wed Oct 9 06:32:47 UTC 2013



> On Oct. 8, 2013, 8:21 p.m., Nemanja Hirsl wrote:
> > players/ai/example/example.cpp, line 36
> > <http://git.reviewboard.kde.org/r/112676/diff/3/?file=199906#file199906line36>
> >
> >     AiExample will not play the game - it will just pass the turn.
> >     This is not stated anywhere and might be confusing for human players.
> >     
> >     Do we really need it in release configuration? Maybe to keep it in debug config if necessary?
> 
> Alexander Schuch wrote:
>     I personally like the idea to add a textual description for humans next to the selected player controller. Information like that can be stated there. But right now I really lack knowledge about how to add new GUI elements. In the source, I already added that description as class description in example.h:25.
>     
>     So for now I propose to simply comment out adding that AI player controller in NewGameDlg::NewGameDlg(). The code can still be compiled, so CMakeLists.txt does not need to be changed anymore. The compiler should notice that this class is not referenced and as such should not add the code to the binary. Right?
>     
>     Or what do you mean by "debug config"? I ran "ccmake" and the only configuration option roughly named that way is called "CMAKE_BUILD_TYPE" which can be set to "Debug".

Adding description gui element next to player might be a good task for future. For now we can remove it (comment out creation of this player) from NewGameDlg::NewGameDlg() as you suggested and really use it once we add description or find another way how to emphasize how computer plays. 
This way user experience will remain the same with just player's type changed (Default Weak/Normal/Hard).
Also, opposed to the dead code, I would like to keep code in example dir because it shows what is really needed in order to add new type of ai player to the game.  


- Nemanja


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


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/20131009/8db6db0f/attachment-0001.html>


More information about the kde-games-devel mailing list