Trying to program a roguelike while simultaneously learning C# and the XNA library is not an easy task. One problem (or benefit, depending on how one sees it) is that I am constantly discovering new, more efficient tools and methods with which to accomplish my goals. Unfortunately, this means I am repeatedly going back over code to fix what wasn’t broken, but could be better.
An example is that I have been using a List<Vector2> to store information on rooms/walls that are connected to the maze. I have been using the list because of the ease of access as compared to an Array, but now I realize that the array’s construction means that the computer can access the data from the array much more easily. It just means that I have to take more care in my programming to make sure that I keep within the bounds of the array. When I’m storing map data, LOS data, and AI map data all in arrays vs lists, however, the gain in speed is noticeable, even with these ASCII-graphics.
EDIT: I realize it was that I had “while (UnconnectedOutWallTiles.Count() > 0 ||…” instead of “.Count() > 0 &&“. Oh well. Live and learn, I guess.