PuzzleGame/PuzzleGameProject/Assets/Scripts/DungeonGenerator/Room.cs

41 lines
No EOL
1 KiB
C#

using System.Collections.Generic;
namespace DungeonGenerator
{
public enum RoomType
{
Normal,
Entrance,
Monster,
}
public class Room
{
public Room(RoomType roomType, int width, int height, Point positionOfTopLeft)
{
TypeOfRoom = roomType;
Width = width;
Height = height;
PositionOfTopLeft = positionOfTopLeft;
}
public RoomType TypeOfRoom { get; set; }
public int Height { get; set; }
public int Width { get; set; }
public Point PositionOfTopLeft { get; set; }
public List<Point> GetPointsInRoom()
{
List<Point> points = new List<Point>();
for (int i = 0; i < Width; i++)
{
for (int j = 0; j < Height; j++)
{
points.Add(new Point(PositionOfTopLeft.X + i, PositionOfTopLeft.Y + j));
}
}
return points;
}
}
}