Data stack/queue

New releases and general discussions.

Post » Wed Apr 01, 2009 5:47 pm

We need a way to store information in form of a stack or queue; the Array object isn't flexible and the hashtable is... uh, unsuitable for certain purposes.

Quite often a flexible data container is needed; it would store any amount of data in the order that it was fed and return it the preferred way - Last In First Out (stack) or First In First Out (queue).

Ex.: I want to score a path - a set of waypoints - that the sprite would follow. I'd also want to remove some waypoints, add more etc., while the sprite would follow waypoints and remove them as it passes them (possibly storing it into another container named "Flight Log" to be able to trace back).

So, it should support adding, removing and inserting entries; the entries would automatically shift when an entry is inserted or removed.

I don't know much about data structures, however Array object is too bulky for those types of operations and hashtable is giving me headaches.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Apr 01, 2009 6:17 pm

This sounds like a good starter project for someone new to the SDK; just basically wrap std::vector (simple and well documented in many places).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests