About Store Forum Documentation Contact



Post Reply 
List, Map, or Dictionary...
Author Message
JamesProctor Offline
Member

Post: #1
List, Map, or Dictionary...
I have a Custom base Class that all of My Game Managers will be inheriting from. I need to have a List, Map, or Dictionary where I add all of the managers to and then loop through them to update them ect. What would be the easiest way to get this done with the least amount of work?

Would be nice to be able to get a manager based on it's name to be able to access it.

Thanks in advance.
09-20-2014 12:04 AM
Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #2
RE: List, Map, or Dictionary...
A few suggestions:

You could create a manager class based on the base Esenthel game object class and derive all your manager classes from this, in which case their update procedures will get called automatically.

You could store pointers to each manager (with respective names for easy access) and pass these to classes that need them. Then a simple loop could be deployed to cycle through these in order to call their update procedures. Handy if the order and timing is important.

Have an overall manager object that stores the pointers in a map with an associated name and allows lookups from calling procedures passing a pointer back which could be stored locally. The Manager object could then control the updates following a single call from where-ever.

Lots of possibilities I guess smile
09-21-2014 09:06 AM
Find all posts by this user Quote this message in a reply
Post Reply