I have created class Square, boxes 1x1x1 with different properties like walls and doors etc. Doors can be open or closed.
Now I need to create class of collections of these squares, class Dungeon. Each dungeon must have its own (ordinary) system of coordinates in the beginning in the square with most northern (x), western (y) and low(z) position. (so another squares will only have positive coordinates). Each square has to border at least with one another square. More, it may not be anything plased on (x,x,x).
I also have to create "spaces", made by squares with open doors.
I want to make a constructor in class Dungeon that will first create a new element of Square, give it zero-coordinates, then create new squares that will border with the previous in a direction that constructor will choose. (Is it a good idea and how to make it choose it?) While creating new squares I will get their coordinates and put it into array, also check that the coordinate will not be (x,x,x), where x- any integer.
I am not sure about how to create spaces without making a new class, please if you have any ideas, help!