Introducing MankalaEngine
Albert Astals Cid
aacid at kde.org
Thu Jul 25 22:24:51 BST 2024
El dijous, 25 de juliol del 2024, a les 23:09:34 (CEST), João Gouveia va
escriure:
> On 7/23/24 22:32, Albert Astals Cid wrote:
> > El dimarts, 23 de juliol del 2024, a les 18:57:56 (CEST), João Gouveia va
> >
> > escriure:
> >> Hi everyone,
> >>
> >> I've been developing MankalaEngine, a library for creating computerized
> >> opponents for Mancala games, as part of my GSoC project.
> >>
> >> In the coming weeks, I'll be developing a GUI for playing Mancala that
> >> uses
> >> this engine, with the objective of integrating both projects into KDE.
> >>
> >> You can check out the library at MankalaEngine
> >> <https://invent.kde.org/joaotgouveia/mankalaengine>. Any feedback is
> >> greatly appreciated.
> >
> > Good work!
> >
> >
> > Runinng make install installs the wrong things
> > https://pastebin.com/raw/1PS1kczY
> >
> >
> >
> >
> > You probably want to rename some of the functions that return bool to
> > isXXX, see these two functions
> >
> > finishGame
> > gameOver
> >
> > by the name it would seem they both do almost the same?
> >
> > Now if the second is called
> >
> > isGameOver
> >
> > It's much clearer what it really does
> >
> > Same for validMove, with that name it would seem it's part of some hint
> > system that will return a valid move, while if the name is isValidMode,
> > it's much clearer that you give it a move and returns yes/no.
> >
> >
> >
> >
> > If the idea is making this a public library (as oposed as something that
> > will just live inside the game itself) it is possible a good idea to use
> > d-pointer/ pimpl for the classes, i.e. Rules should not have the private
> > members directly in the class but hidden in a Private class, search the
> > internet, there's extensive documentation about that.
> >
> >
> >
> > Cheers,
> >
> > Albert
> >>
> >> If you're interested, you can also check out my blog posts documenting
> >> the
> >> library's development at joaotgouveia.com.
>
> Thank you for your feedback!
>
> I've renamed functions that return boolean values to names that better
> convey this, as per your suggestion.
>
> I've also fixed the installation process and added a section to the
> project's README detailing how to incorporate MankalaEngine in projects
> using CMake. However, I have only tested installing and using the
> library as a dependency in a project on Linux.
>
> Regarding the use of the PImpl idiom, is it really justifiable in this
> case? Since every class is fairly simple, implementing them using PImpl
> seems a bit overkill.
pimpl is not about simplicity, pimpl is about being able to maintain library
binary compatibility more easily.
See
https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B
specially the "Definition" section and the section about "Using a d-Pointer".
Cheers,
Albert
More information about the kde-games-devel
mailing list