xmke / xnova

XNova is a free opensource OGame clone. This one is a french fork under maintenance :D
GNU General Public License v3.0
13 stars 7 forks source link

Suggestion: Refactor Xnova installation scripts / Start using classes #17

Open wvandenhaak opened 2 years ago

wvandenhaak commented 2 years ago

Dear,

I would like to propose to refactor the Xnova installation scripts.

Refactoring would help improving the readability and understanding of the code. It also may allow us to remove duplicate code and reduce the size of the codebase.

Besides refactoring I would also like to start creating classes. Classes can help separate functionality and remove duplicate code. These classes will still contain a bunch of legacy code (because we don't want to break functionality) but we can fix that in future refactoring once the codebase is cleaned up. After a class have been created we can slowly start to replace pieces of code for the class. I think this will also allow us to remove the file includes which create variables and define functions (for example: $lang/$user variable and doQuery() function). For these classes I would like to introduce a new folder in the src folder called Legacy. We can use this folder to create classes without focussing on folder structure too much. The full namespace will be Xmke\Xnova\Legacy.

If you like the idea about refactoring the scripts and/or start using classes, please let me know. I am able to create an example if needed.