Image

Imageilja_l wrote in Imagejava_dev

simulating 2-dimensional array via the List

I' having this problem - I need a data structure for the map of some area (2D). Each element is a room. So with arrays it would be as simple as Room[][] themap. The thing is that it is not known how big this map is. So the first idea was to use List instead of an array. But I don't exactly understand how to do that. Could anyone help?

Or perhaps the idea to use Lists is generally wrong and there are other ways?