UNTESTED Implemented connection rooms.
This commit is contained in:
parent
2baa78bd90
commit
1c447ce510
3 changed files with 261 additions and 46 deletions
|
|
@ -165,5 +165,31 @@ namespace DungeonGenerator
|
|||
_occupiedPoints.ExceptWith(points);
|
||||
_unoccupiedPoints.AddRange(points);
|
||||
}
|
||||
|
||||
// Node rooms are the rooms placed around each monster room and the boss room.
|
||||
public List<Room> GetNodeRooms()
|
||||
{
|
||||
List<Room> nodeRooms = new List<Room>();
|
||||
nodeRooms.AddRange(_monsterRooms.SelectMany(room => room.GetAdjacentRooms()));
|
||||
nodeRooms.AddRange(_bossRoom.GetAdjacentRooms());
|
||||
return nodeRooms;
|
||||
}
|
||||
|
||||
public Dictionary<RoomSide, Room> GetNodesWithSides()
|
||||
{
|
||||
Dictionary<RoomSide, Room> nodesWithSides = new Dictionary<RoomSide, Room>();
|
||||
foreach (Room room in _monsterRooms)
|
||||
{
|
||||
foreach (var kvp in room.GetAdjacentRoomsDict())
|
||||
{
|
||||
foreach (Room adjacentRoom in kvp.Value)
|
||||
{
|
||||
nodesWithSides[kvp.Key] = room;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nodesWithSides;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue