How do I structure a high integration program

I am making a sizable program to randomly make maps.

My problem is that I want to choose variations for different map types, and thus I want to separate out these various segments into different files to make editing and writing them easier.

Normally I'd just make new classes, but in this case I use so many of the same variables in lots of places and the 3d vector "map" needs to be accessed from 75% of the functions, so I can't really export to different classes as then I need to create a new map inside each one.

So the only solutions I can think of is to be passing pointers around like candy (I really don't want the headache of that many pointers flying around), or make one very large file.

Are there some other ways I can make this a bit easier on myself?

If not, how do I make a pointer to a 3d vector (vector of vectors of vectors of int)?
Sounds like you need a resource manager. While writing a basic game engine a year or so ago, I finally found a good reason to use the Singleton design pattern.
http://en.wikipedia.org/wiki/Singleton_pattern
The resource manager was a good fit for this. Then all I had to do in anything that needed resources was #include "managers/ResourceManager.h" and the code to get the instance auto rm = ResourceManager.getInstance();
Last edited on
Thanks, this looks like it work.
Topic archived. No new replies allowed.