Project Architecture
This project (Github branch main) I built this app entirely in CPP and I used the CrowCpp framework to run it.
I created some custom includes with all the custom libraries for each one.
Mysql.h MySQL Connector/C++ to grant the ability to my application to be able to connect to my mysql database. I got the sql cpp con from this package libmysqlcppconn-dev.
Player.h which comes in as a new player gets created. It handles the initialization stuff like initial xp date of creation xp required. Basically sets the player up.
PlayerGrowth.h comes in when player sets or completes tasks. The calculation of rewarding xp by fetching from database and setting new ones back.
Setup.h is the bootstrap for the application that creates the tables required for the application in the database.
I used CMAKE as my compiling tool followed by make.
So in summery as new player is created Player.h comes in to do the formalities with giving back the UID generated to the player. As in LoadGame section when tasks created or completed and displaying of stats is handled by PlayerGrowth.h and as the app starts the Setup.h bootstraps it. Mysql.h works behind for the communication from app to database. The Auxiliary.h is just another custom header I made to enforce DRY(Don't Repeat Yourself)
Top comments (0)