Game Development Community

TGE Map / HashTable Class

by William Todd Scott · in Torque Game Engine · 04/25/2006 (8:39 am) · 3 replies

Has any created an STL-like map class?

I would like to remove the use of STL from a couple of my classes, but I really need the map functionality. (Showing a little laziness, I didn't want to write one up if it already existed :) )


Thanks
Todd

#1
04/25/2006 (8:54 am)
There is an Array resource that you can extend very easily into being a hash like structure (I did this by adding maybe 10 lines).

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4711

You just need to add a getValueByKey() and similar.
#2
04/25/2006 (9:07 am)
Thanks Thomas,

That just saved me a ton of time.

Todd
#3
04/25/2006 (10:08 am)
I can't share the source,
but someone at my work did implement STL Map for strings, exposing it to torque script. SOooo useful.
it's only about 200 lines of pretty fluffy C++.