Game Development Community

Ordered Containers

by Nick Wilson · in Torque Game Builder · 06/01/2007 (3:57 pm) · 2 replies

Are there any ordered containers that support non unique values available in torque script or the TGB source? I'm looking for something along the lines of a queue or a deque for a customizable card game. I've poked around in the documentation and only found SimSet. I was wondering if I had any choices besides implementing my own container class in the source code or using arrays in script (which seems sloppy).

If I do need to roll my own container in source, does anyone have a suggestions? I know the STL container classes butt heads with the memory manager. Would I run in to the same problem if I just made my own with a linked list?

#1
06/02/2007 (2:11 am)
SimSets have a pushToFront/pushToBack method iirc, and can be used to enforce orderedness--you could just make sure you use that directly, or wrapper it within a new class.
#2
06/04/2007 (1:59 pm)
SimSet's in TGB also have a .reorderChild(child1, child2) function.