Fixed rooms being created where they would collide with an unavailable point on the map.

This commit is contained in:
Max 2025-02-05 15:49:10 +01:00
parent d091a7f745
commit 5f2be1333b
3 changed files with 36 additions and 31 deletions

View file

@ -29,14 +29,13 @@ namespace DungeonGenerator
EvenDisperser disperser = new EvenDisperser(_xLength, _yLength, _entrancePoints); //TODO calculate L and W from length
int numberOfMonsterRooms = 7; // TODO: Calculate from ratio
for (var i = 0; i < numberOfMonsterRooms; i ++)
{
Point newSpot = disperser.GetPoint(SIDE_LENGTH_OF_MONSTER, SIDE_LENGTH_OF_MONSTER);
_monsterRooms.Add(new Room(
RoomType.Monster,
_monsterRooms.Add(disperser.GenerateAndPlaceRoom(
SIDE_LENGTH_OF_MONSTER,
SIDE_LENGTH_OF_MONSTER,
SIDE_LENGTH_OF_MONSTER,
newSpot));
RoomType.Monster));
}
}