Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Orpheum

containers, containers, and more containers

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

So what is everyone''s preferred container for graphics, sound, monsters, and items? Do you prefer an array for one, and a linked list for others? What about the STL list? I would like them to be dynamic, supporting adding and deleting, perhaps even sorting. I''m just trying to get the best mix of speed and flexibility, while still being resource friendly. My current scheme for caching tiles is creating an array of type BITMAP*[256], then allocating each element as needed. Lame to be sure (this is my first forray into game development afterall), but without having some professional (or atleast semi-pro) =) input, it is impossible to know what the best solution is. So, there it is... hopefully we''ll see who has the most efficient caching method for bitmaps and sound, and the best method for dealing with dynamic objects in game like monsters and items

Share this post


Link to post
Share on other sites
Advertisement
stl. Use the right container for the job. ie. vector where you would normally use an array, deque where you need something array-like but might need to add and remove at both the front and back, list where you need to be adding and removing in the middle, and map where you need quick lookups of an object based on a key field.

Of course, I''m still annoyed about the limitation on STL with pointers (requires an unnecessary definition of the pointer''s type), and should really get around to coding the workaround for my program sometime soon.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!