I’m using the DLinkedList class from AS3 Data Structures For Game Developers at http://lab.polygonal.de/ds/ and i’m having trouble accessing the data in a workable way.
I’ve set it up as follows to create a multidimensional linked list.
//create linked list
layerContents[1] = new DLinkedList();
for (var l:uint = 1; l <=15;l++){
//create a node within linked list with another linked list
layerContents[1].append(new DListNode(new DLinkedList()));
}
//create an iterator to access the first linked list
var itr:DListIterator = layerContents[1].getListIterator();
When i can veiw the current node data like this
trace(itr.data + "CURRENT NODE DATA")
The problem is, unlike an array I can’t go “myArray[1][5].aMethod”, I need to use the append method on the object that the data returns, which would be another Linked List. I can’t work out how to do it.
Help would be appreciated.