using System.Collections.Generic; using System.Linq; using UnityEngine; namespace BlueWater.Tycoons { public class CustomerTable : MonoBehaviour { [SerializeField] private List _tableSeats; private void OnEnable() { TycoonManager.Instance.CustomerTableController.RegisterTable(this); } private void OnDisable() { if (!TycoonManager.Instance) return; TycoonManager.Instance.CustomerTableController.UnregisterTable(this); } public TableSeat FindEmptySeat() { return _tableSeats.FirstOrDefault(tableSeat => !tableSeat.IsReserved && !tableSeat.IsOccupied && tableSeat.IsCleaned); } } }