CapersProject/Assets/02.Scripts/Tycoon/CustomerTableManager.cs

29 lines
776 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Linq;
using BlueWater.Utility;
using UnityEngine;
namespace BlueWater.Tycoons
{
public class CustomerTableManager : MonoBehaviour
{
[SerializeField]
private List<CustomerTable> _customerTables;
public void RegisterTable(CustomerTable table)
{
Utils.RegisterList(_customerTables, table);
}
public void UnregisterTable(CustomerTable table)
{
Utils.UnregisterList(_customerTables, table);
}
public TableSeat FindEmptySeat()
{
return _customerTables.Select(customerTables => customerTables.FindEmptySeat())
.FirstOrDefault(emptySeat => emptySeat != null);
}
}
}