2024-04-28 13:55:19 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using ColdMint.scripts.map.interfaces;
|
2024-05-20 14:38:41 +00:00
|
|
|
|
using ColdMint.scripts.map.room;
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
namespace ColdMint.scripts.map.roomHolder;
|
|
|
|
|
|
|
|
|
|
public class RoomHolder : IRoomHolder
|
|
|
|
|
{
|
2024-05-20 14:38:41 +00:00
|
|
|
|
private readonly List<Room> _rooms = new List<Room>();
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
2024-05-20 14:38:41 +00:00
|
|
|
|
public bool AddRoom(Room room)
|
2024-04-28 13:55:19 +00:00
|
|
|
|
{
|
|
|
|
|
_rooms.Add(room);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-20 14:38:41 +00:00
|
|
|
|
public Room? LastRoom
|
2024-04-28 13:55:19 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_rooms.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
return _rooms[_rooms.Count - 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int PlacedRoomNumber => _rooms.Count;
|
|
|
|
|
}
|