Skip to main content
gamedev.net
🔒 Locked

Game Data Structure

Started by AcePilot Apr 4, 2005 at 5:11 PM 3 replies 900+ views
Original Post
AcePilot
AcePilot
After planning out my game, i realised that i would need a place to store information like the active bullets etc. First i thought of arrays, but what if the data to be stored was bigger than the array itself? so i thought if I could use an expandable data structure like a linked list i would be able to continue on. I couldnt use a linked list because i need to "scan" through the objects rather than pop them out. Anyone have any ideas for a structure like this? Help would be appreciated. By the way im programming in C so a C or C++ structure would do. (The ArrayList class in C# or VB.NET is exactly what i want)
Telastyn
Telastyn
You don't need to pop a member of a linked list, that would be a fairly restrictive stack.

Linked lists would be fine, though you'd be well advised to search for the Standard Template Library, and use one of it's container classes [if C++ structures really are OK].
Enokh
Enokh
std::vector. It gives you standard c style array performance by all means, and is dynamic just like a list. Just won't erase from the vector from any cell but the back of it and you're golden.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.