Implemented generation of normal rooms around monster rooms. They still collid with each other.

This commit is contained in:
Max 2025-02-06 14:47:35 +01:00
parent 2cd9df5652
commit e0c65bd66e
3 changed files with 256 additions and 6 deletions

View file

@ -1,4 +1,6 @@
using System.Collections.Generic;
using NUnit.Framework;
using Unity.VisualScripting;
namespace DungeonGenerator
{
@ -19,7 +21,12 @@ namespace DungeonGenerator
Height = height;
PositionOfTopLeft = positionOfTopLeft;
}
private List<Room> _topAdjacentRooms = new List<Room>();
private List<Room> _bottomAdjacentRooms = new List<Room>();
private List<Room> _leftAdjacentRooms = new List<Room>();
private List<Room> _rightAdjacentRooms = new List<Room>();
public RoomType TypeOfRoom { get; set; }
public int Height { get; set; }
public int Width { get; set; }
@ -50,5 +57,45 @@ namespace DungeonGenerator
{
return new Point(PositionOfTopLeft.X + Width / 2, PositionOfTopLeft.Y + Height / 2);
}
public void AddTopAdjacentRoom(Room room)
{
_topAdjacentRooms.Add(room);
}
public List<Room> GetTopAdjaceRooms()
{
return _topAdjacentRooms;
}
public void AddBottomAdjacentRoom(Room room)
{
_bottomAdjacentRooms.Add(room);
}
public List<Room> GetBottomAdjaceRooms()
{
return _bottomAdjacentRooms;
}
public void AddLeftAdjacentRoom(Room room)
{
_leftAdjacentRooms.Add(room);
}
public List<Room> GetLeftAdjaceRooms()
{
return _leftAdjacentRooms;
}
public void AddRightAdjacentRoom(Room room)
{
_rightAdjacentRooms.Add(room);
}
public List<Room> GetRightAdjaceRooms()
{
return _rightAdjacentRooms;
}
}
}