2024-08-29 09:51:32 +00:00
|
|
|
using BlueWater.Items;
|
2024-08-27 12:23:41 +00:00
|
|
|
using BlueWater.Uis;
|
|
|
|
using UnityEngine;
|
2024-09-02 13:45:46 +00:00
|
|
|
using UnityEngine.Serialization;
|
2024-08-27 12:23:41 +00:00
|
|
|
|
|
|
|
namespace BlueWater.Tycoons
|
|
|
|
{
|
|
|
|
public class Brewing : InteractionFurniture
|
|
|
|
{
|
|
|
|
[SerializeField]
|
2024-08-29 09:51:32 +00:00
|
|
|
private DrinkCategory _category;
|
|
|
|
|
2024-09-02 13:45:46 +00:00
|
|
|
[FormerlySerializedAs("_currentDrinkData")] [SerializeField]
|
|
|
|
private LiquidData currentLiquidData;
|
2024-08-27 12:23:41 +00:00
|
|
|
|
|
|
|
[SerializeField]
|
|
|
|
private int _currentQuantity;
|
|
|
|
|
|
|
|
public override void Interaction()
|
|
|
|
{
|
|
|
|
var brewingUi = TycoonUiManager.Instance.BrewingUi;
|
|
|
|
brewingUi.SetBrewing(this);
|
|
|
|
brewingUi.Open(TycoonUiManager.Instance.PopupUiList);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool CanInteraction()
|
|
|
|
{
|
|
|
|
return !IsOpened;
|
|
|
|
}
|
|
|
|
|
2024-09-02 13:45:46 +00:00
|
|
|
public void SetDrink(LiquidData liquidData)
|
2024-08-27 12:23:41 +00:00
|
|
|
{
|
2024-09-02 13:45:46 +00:00
|
|
|
currentLiquidData = liquidData;
|
|
|
|
_currentQuantity = currentLiquidData.Amount;
|
2024-08-27 12:23:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsEmptyDrink()
|
|
|
|
{
|
2024-09-02 13:45:46 +00:00
|
|
|
return currentLiquidData == null || _currentQuantity <= 0;
|
2024-08-29 09:51:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public DrinkCategory GetDrinkCategory()
|
|
|
|
{
|
|
|
|
return _category;
|
2024-08-27 12:23:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|