Jump to content
  • Advertisement
Sign in to follow this  
nuclear123

Manager Class?

This topic is 2480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i notice most games use a Master class which acts as a manager for other classes/objects created throughout the game. My question is what design pattern/methodology is this reffered to so i can find information on such a design practice.

Share this post


Link to post
Share on other sites
Advertisement
You might want to take a look here, it will give you examples on all the design patterns as well.
http://www.dofactory.com/Patterns/Patterns.aspx

Share this post


Link to post
Share on other sites
Well, it could be a god object, but I'm not sure.

It's not uncommon (in fact, it's quite common) to have some central object keep and initialize/deinitialize subsystems/components. I can't really see which pattern that would be though.

Share this post


Link to post
Share on other sites
It's called the [font="Courier New"]main[/font] function cool.gif

There's kind of two things going here.
One is the entry-point -- when you start up the game, you initially need to create a lot of systems. Sometimes this is done by some kind of 'Engine' object. In any case, if one 'Engine' is instantiated at the start of the program (in order to initialize systems), then this is equivalent to simply making all of those systems local variables of the main function... This is just start-up logic, so I'd call it the "main function pattern", though it's more trope than a pattern.

The second part is the "context pattern": you realise that tasks A, B and C will all require the use of objects X, Y and Z, so you place references to those objects into a Context object for ease of sharing. Although context objects are very common, it's also often an anti-pattern when used incorrectly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!