Re: Introducing MankalaEngine
Albert Astals Cid <[email protected]> Thu, 25 Jul 2024 23:24:51 +0200
| Newsgroups | gmane.comp.kde.devel.games |
|---|---|
| Message-ID | <4072085.PD9p9kOLEd@xps15> |
El dijous, 25 de juliol del 2024, a les 23:09:34 (CEST), Jo=C3=A3o Gouveia = va=20 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=C3=A3o Gou= veia va > >=20 > > escriure: > >> Hi everyone, > >>=20 > >> I've been developing MankalaEngine, a library for creating computerized > >> opponents for Mancala games, as part of my GSoC project. > >>=20 > >> 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. > >>=20 > >> You can check out the library at MankalaEngine > >> <https://invent.kde.org/joaotgouveia/mankalaengine>. Any feedback is > >> greatly appreciated. > >=20 > > Good work! > >=20 > >=20 > > Runinng make install installs the wrong things > > https://pastebin.com/raw/1PS1kczY > >=20 > >=20 > >=20 > >=20 > > You probably want to rename some of the functions that return bool to > > isXXX, see these two functions > >=20 > > finishGame > > gameOver > >=20 > > by the name it would seem they both do almost the same? > >=20 > > Now if the second is called > >=20 > > isGameOver > >=20 > > It's much clearer what it really does > >=20 > > 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. > >=20 > >=20 > >=20 > >=20 > > 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. > >=20 > >=20 > >=20 > > Cheers, > >=20 > > Albert > >>=20 > >> If you're interested, you can also check out my blog posts documenting > >> the > >> library's development at joaotgouveia.com. >=20 > Thank you for your feedback! >=20 > I've renamed functions that return boolean values to names that better > convey this, as per your suggestion. >=20 > 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. >=20 > 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 librar= y=20 binary compatibility more easily. See=20 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