Esempio n. 1
0
 private void FillRoom(int x, int y, string name, ITileLayer pathLayer)
 {
     if (Rooms[x][y] != null)
     {
         if (Rooms[x][y].Name == name)
         {
             Log.Instance.Info("RoomTile " + name + " has two AreaLabels.");
         }
         else {
             Log.Instance.Warn("Two AreaLabels in one RoomTile: \"" + Rooms[x][y] + "\", \"" + name + "\".");
         }
         return;
     }
     var room = new Room(name);
     ExpandRoom(x, y, room, pathLayer);
 }
Esempio n. 2
0
 private void ExpandRoom(int x, int y, Room room, ITileLayer pathLayer)
 {
     if (Rooms[x][y] != null) return;
     if (!(pathLayer.GetActorAt(x, y) is RoomTile)) return;
     Rooms[x][y] = room;
     room.Size++;
     ExpandRoom(x + 1, y, room, pathLayer);
     ExpandRoom(x, y + 1, room, pathLayer);
     ExpandRoom(x, y - 1, room, pathLayer);
     ExpandRoom(x - 1, y, room, pathLayer);
 }