You have a game with different schools of magic (fire, ice, etc). Each school has a set of properties that pertain to independent features of the game, such as:
- strings to be displayed on the GUI (generic data stored in memory)
- graphics, sounds, and other files to be loaded as necessary
- different behaviours (code), e.g. each school of magic has a different interaction with various terrain types
I can think of two designs for implementing this, but I don't particularly like either of them.
- I could make an abstract
MagicSchoolclass that contains all the various properties of a given school. This makes the
MagicSchoolclass dependent on many distinct features of the game (GUI, SFX, other areas of game logic etc), which seems like an unnecessary mixing of concerns (something of a god class).
- I could put the GUI/SFX/etc data for each school in the GUI/SFX/etc systems as arrays. But then the code for the magic schools gets scattered all across the project (albeit in very logical places).
So in this case, there are two axes along which to structure code: the various magic schools, and the various features in which the schools feature.
In terms of clarity and maintainability, which of the above two solutions should I prefer? Or perhaps there's another way I haven't considered yet?