Splitting A Room
#PanicRoom Day 091
#100DaysOfGameDev R2D56
#100DaysOfCode R2D56
With a separate method laid out for dividing a room when necessary, I turned my attention back to Room Analyzer to refine it even more. By setting condition variables and really boiling down the condition qualifications I was able to make it as small as possible.
Doing this gave me the opportunity to look at how I am going to assign values to additional rooms created in this manner. I already have a way to clearly define rooms Aa and Ab, but how am I going to define a room Ac or even Ad, if it comes to that?
I originally thought I was going to use an array, because I could store not only the room identifier but also the room coordinates along with it if I made it multi-dimensional, but I have no way of knowing how large to pre-define the size of such an array before the House is procedurally-generated. This led me to look at Lists.
A list would be a good way to annotate information as it becomes relevant, and I can change it as it goes. This became really important when I thought of how I would handle room assignments if Aa needed to be split and Ab didn’t. How would I handle Aa and Ac being on one side of Ab? I really want to keep things linear so they are easier to track in an ever-changing build and a List would make it possible for me to reassign Ab as Ac and split Aa into Aa and Ab in the aforementioned scenario. I haven’t solved the issue yet, but that is coming. For now, I DO have the ability to split a room a second time, so that is a good position to be in right now.