TheOpenSpaceProgram / osp-magnum

A spaceship game
https://www.openspaceprogram.org/
MIT License
216 stars 32 forks source link

Scenario System Refactor #277

Closed Ben-Bingham closed 6 months ago

Ben-Bingham commented 6 months ago

I refactored the current method of loading scenarios, the main changes are:

1) Switched from storing scenarios in an unordered map where the name of the scenario was the key and the description and setup function were the value, to a singleton class that has member functions that search for you.

2) Separated each Scenario into its own file, this will be especially helpful in the future when multiple scenarios are being worked on on multiple different branches.

3) In many parts of the code scenarios are referred to as "scenes" and I changed a lot of those to all be scenario, there are still some left, but they affect parts of the code I have not looked at yet.

Overall I didn't change any functionality, at least nothing was changed intentionally, mostly just changes to improve readability

Ben-Bingham commented 6 months ago

Thank you for the feedback, I think your exactly correct in that I went way to overboard on one idea and way overcomplicated it, I'm going to try again and this time just straighten out the files as opposed to reinventing everything.

Also I don't think you were too harsh at all, I'm relatively new to programming/software dev and am still very much learning, I really appreciate that you were honest with me, as it will definitely help me become better.