28 lines
949 B
C#
28 lines
949 B
C#
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver
|
|
{
|
|
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
|
|
{
|
|
if (CanExecuteInteraction() == false) return false;
|
|
|
|
GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant);
|
|
return true;
|
|
}
|
|
|
|
private RestaurantManagementStateSo GetManagementState()
|
|
{
|
|
return RestaurantState.instance.ManagementState;
|
|
}
|
|
|
|
public bool CanExecuteInteraction()
|
|
{
|
|
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
|
|
|
|
return currentGameFlowState == GameFlowState.ReadyForRestaurant && GetManagementState().IsOpenable();
|
|
}
|
|
}
|
|
} |