solver 수정 및 오픈 레스토랑 solver 추가

This commit is contained in:
NTG_Lenovo 2025-08-07 13:12:02 +09:00
parent a778a9d58c
commit a265bd3440
2 changed files with 29 additions and 2 deletions

View File

@ -6,12 +6,18 @@ public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolv
{ {
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
{ {
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; if (CanInteract() == false) return false;
if (currentGameFlowState != GameFlowState.ReadyForRestaurant) return false;
var evt = GameEvents.OpenPopupUiEvent; var evt = GameEvents.OpenPopupUiEvent;
evt.UiType = typeof(RestaurantManagementUi); evt.UiType = typeof(RestaurantManagementUi);
EventBus.Broadcast(evt); EventBus.Broadcast(evt);
return true; return true;
} }
public bool CanInteract()
{
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
return currentGameFlowState == GameFlowState.ReadyForRestaurant;
}
} }
} }

View File

@ -0,0 +1,21 @@
using UnityEngine;
namespace DDD
{
public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver
{
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
{
if (CanInteract() == false) return false;
GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant);
return true;
}
public bool CanInteract()
{
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
return currentGameFlowState == GameFlowState.ReadyForRestaurant;
}
}
}