From a265bd3440a9d0914b8e1f85e356fe63eac245e2 Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Thu, 7 Aug 2025 13:12:02 +0900 Subject: [PATCH] =?UTF-8?q?solver=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20?= =?UTF-8?q?=EC=98=A4=ED=94=88=20=EB=A0=88=EC=8A=A4=ED=86=A0=EB=9E=91=20sol?= =?UTF-8?q?ver=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RestaurantManagementUiEventSolver.cs | 10 +++++++-- .../RestaurantOpenEventSolver.cs | 21 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs index 50f1c83ef..751a9fdfb 100644 --- a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantManagementUiEventSolver.cs @@ -6,12 +6,18 @@ public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolv { public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null) { - GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; - if (currentGameFlowState != GameFlowState.ReadyForRestaurant) return false; + if (CanInteract() == false) return false; + var evt = GameEvents.OpenPopupUiEvent; evt.UiType = typeof(RestaurantManagementUi); EventBus.Broadcast(evt); return true; } + + public bool CanInteract() + { + GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState; + return currentGameFlowState == GameFlowState.ReadyForRestaurant; + } } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs new file mode 100644 index 000000000..68c499998 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantEvent/RestaurantOpenEventSolver.cs @@ -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; + } + } +} \ No newline at end of file