Pretty broad question. I am looking for refactoring an existing game application so that we have a basic platform for games that are complemented by some modular plugin architecture. So we have:
GameCore - many base classes, etc. GameBundle A / B / C ... - packages with a large number of subclasses in the kernels, as well as many resources
The game will not work at all without a specific package that implements the game itself. Theoretically, one could also break these bundles and mix and match. This is a very attractive design.
Using the NSBundle seems to be the neatest solution, but I hit some errors: the code in the GameBundle must be linked to the GameCore or it will not compile, but then when the GameCore code is loaded from the NSBundle, you get duplicates of all the main classes. This suggests that I do not agree with how I approach this!
This can be easily implemented using static libraries, but then it's not easy to include resources ...
So, can anyone suggest a workable architecture that will do what I want? Summarizing;
Abstract game core An undetermined number of GameBundles added to the target that (ideally) load dynamically at run time.
Hope someone can help!
source share