Due to some, really dumb past decisions, I made the Event class to basically act as a struct of sorts. The issue is, that's completely unnecessary since the dictionary is already structured and the class has no unique methods. As such, I'm retroactively deleting the Event class and replacing it with dictionaries instead. This way, I can save and load events easily from a master list. These event dictionaries can then be easily saved and loaded instead of having to do a cumbersome process of decompiling the object into a dictionary and recompiling it into an object with the said dictionary.
Another benefit of doing this is that I can easily create a script to retroactively add more keys to the event dictionary and have everything work as intended.
To help with this, I also created a function in SaveManager called Tuplefy2 which turns all lists in the dictionary back into a tuple for ScreenManager.
PR checklist
[x] All Pytests pass
[x] All changes are documented somewhere in the commit
[x] Rpg2.py is tested and works even with the changes
Pygame-RPG 19.6 Housekeeping and bugfixing
Due to some, really dumb past decisions, I made the Event class to basically act as a struct of sorts. The issue is, that's completely unnecessary since the dictionary is already structured and the class has no unique methods. As such, I'm retroactively deleting the Event class and replacing it with dictionaries instead. This way, I can save and load events easily from a master list. These event dictionaries can then be easily saved and loaded instead of having to do a cumbersome process of decompiling the object into a dictionary and recompiling it into an object with the said dictionary.
Another benefit of doing this is that I can easily create a script to retroactively add more keys to the event dictionary and have everything work as intended.
To help with this, I also created a function in SaveManager called
Tuplefy2
which turns all lists in the dictionary back into a tuple for ScreenManager.PR checklist