Jump to content
  • Advertisement
Sign in to follow this  
Penance

Managing Objects

This topic is 4853 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'm looking for some suggestions on managing game objects. This is for a simple game engine that I will use to make demos. Right now I have an Entity class and four classes (zone, area, actor, item) that inherit from it and specialize as appropriate. Zones can store areas, Areas can store items and actors. Actors can store items and items can store other items. Every entity has a unique id associated with it. I handle entities managing ownership of other entities by refering to owned enities by their id. Right now, to store the actual objects, I use hashtables. I have a class called EntityManager that has 4 hashtables, one for each entity type. I'm just wondering if there's some nice design patterns to handle situations like this without resorting to switch statements and duplicate code. Or if maybe there's a better way to manage game objects, period. I'd like to hear how other people have chosen to do it =)

Share this post


Link to post
Share on other sites
Advertisement
Thanks for the response. That's a very nice design pattern, I had forgotten about it. I'll see if I can incorporate it into my design...at least it's a start!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!