Sign in to follow this  

Managing Objects

This topic is 4660 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

This topic is 4660 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this