-
Notifications
You must be signed in to change notification settings - Fork 7
Refactoring code
Introduction
One day I sat down and decided to create a bunch of mods for JABIA. I didn't have a particular plan, just threw down some code and did a bit of reverse engineering. A few furious coding hours later, I had a pile of code that did not look that great.
Templating boost XML serialization
The project ended up structured as a collection of DLLs that would get injected into the game and each DLL would do its own thing. Things like patching and function hooking. I wanted these mods to be somewhat user configurable, so I had a parameter data structure for each mod that boost would serialize/deserialize.
Unfortunately, each DLL had it's own implementation of the save and load function, and because I was in a hurry their signatures where different. A clean up was in order, so I sat down and templated the save and load functions. You can see them here game_version.h In all, this eliminated 3 different implementations of these functions which makes adding new mod modules which use xml serialization really easy.