Cysion
08-15-2007, 10:07 AM
Aloha people,
A question concerning modifying iterators in java, and if it weren't for the fact that I already waisted few hours on it, then I'd really like your help :p
Ok, this is the problem: we have a virtual dungeon, all squares in that dungeon are saved in a vector. All these squares have certain coordinates (x,y,z). Now we need to make an iterator in dungeon that iterates over all these squares and returns the squares in the following order: x in ascending order, then y in ascending order and finally z in ascending order. So the square with the lowest x has to be returned first. E.g.: (1,0,0), (1,1,0) (2,1,0) (2,1,9) etc....
Anyone an idea how to coop witt all of this? Thanks in advance :D
A question concerning modifying iterators in java, and if it weren't for the fact that I already waisted few hours on it, then I'd really like your help :p
Ok, this is the problem: we have a virtual dungeon, all squares in that dungeon are saved in a vector. All these squares have certain coordinates (x,y,z). Now we need to make an iterator in dungeon that iterates over all these squares and returns the squares in the following order: x in ascending order, then y in ascending order and finally z in ascending order. So the square with the lowest x has to be returned first. E.g.: (1,0,0), (1,1,0) (2,1,0) (2,1,9) etc....
Anyone an idea how to coop witt all of this? Thanks in advance :D