Data Structures released
May 10, 2007 on 7:03 pm | In Actionscript, data structures | 7 CommentsI’ve just released the first version of my data structures package for AS3.
There is no example code included, but I have started writing some simple demonstrations which I’ll post successively.
Thanks for this!
Comment by Rendall — May, 11 2007 #
I think there is an error in the Graph code. The api says the “size” argument for the constructor is for “The total number of nodes allowed.” However, looking at the code this only pre-populates the nodes array with “size” number of elements, but this array can still exceed this amount through the addNode method. Also, in the clear method:
public function clear():void
{
nodes = new Array(size);
_nodeCount = 0;
}
The nodes array gets initialized with a number of elements equal to the current number of nodes in the graph instance (e.g. what myGraph.size returns), which could be under or over the size number initially passed into the constructor. It seems pointless to have size at all in the constructor unless there is a performance gain to initializing the nodes array with an arbitrary number of elements.
All in all this is a great package, thanks for sharing.
Any plans to create a svn repository for the code?
-Ans
Comment by Anselm Bradford — May, 15 2007 #
I have been waiting for this… Thanks.
Comment by draw.logic — May, 16 2007 #
of course the current release is far from being perfect and there are still some bugs. I’m also not very good at documenting code ;-)
and yes I’m looking for a svn server, perhaps on osflash.org ?
Comment by mike — May, 16 2007 #
[...] This library by polygonal.de looks really nice. I would most definitely be using this for future development. [...]
Pingback by Data Structures for Game Development in AS3 — November, 8 2007 #
I found one problem with your HashMap implementation (that uses Dictionaries). You cannot map multiple same values. I understand that keys should be unique but I doubt this should be the case with values too.
Comment by sascha/hdrs — November, 18 2007 #
sascha, you are right, this shouldn’t happen. I’ll fix this ASAP.
Comment by Michael — November, 18 2007 #