Traveller/scripts/map/roomPlacer/RoomPlacerTemplate.cs
2024-04-28 21:55:19 +08:00

36 lines
839 B
C#

using System.Collections.Generic;
using System.Threading.Tasks;
using ColdMint.scripts.map.dateBean;
using ColdMint.scripts.map.interfaces;
using Godot;
namespace ColdMint.scripts.map.RoomPlacer;
public abstract class RoomPlacerTemplate : IRoomPlacer
{
private List<IRoom> _placedRooms;
protected void Init()
{
_placedRooms = new List<IRoom>();
}
public abstract Task<bool> PlaceRoom(Vector2 position, IRoom room);
public abstract Task<Vector2> CalculatedPosition(IRoom mainRoom, IRoom newRoom, RoomSlot mainRoomSlot, RoomSlot newRoomSlot,
RoomPlacerConfig roomPlacerConfig);
public int PlacedRoomNumber
{
get
{
if (_placedRooms == null)
{
return 0;
}
return _placedRooms.Count;
}
}
}