From 3099961e6539425ad0ee070b683a7ab7aa2af687 Mon Sep 17 00:00:00 2001 From: NTG Date: Sun, 17 Aug 2025 16:31:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=94=EB=A6=AC=EB=8F=84=EA=B5=AC-=EC=98=A4?= =?UTF-8?q?=EB=8A=98=EC=9D=98=EB=A9=94=EB=89=B4=20=EB=A7=A4=EC=B9=AD=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TodayMenuUi/TodayMenuSlotUiStrategy.cs | 4 +--- .../TodayCookwareSlotUiStrategy.cs | 11 ++++++++++- .../FlowStates/RestaurantManagementStateSo.cs | 10 ++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs index 5cc97f1e2..308158b71 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayMenuUi/TodayMenuSlotUiStrategy.cs @@ -14,8 +14,6 @@ public TodayMenuSlotUiStrategy(RecipeType recipeType) public void Setup(ItemSlotUi ui, ItemViewModel model) { - var restaurantManagementStateSo = RestaurantState.instance.ManagementState; - if (model == null) { string emptySpriteKey = null; @@ -37,7 +35,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) } string markSpriteKey = null; - if (restaurantManagementStateSo.IsCookwareMatched(ui.Model.Id)) + if (RestaurantState.instance.ManagementState.IsCookwareMatched(ui.Model.Id)) { markSpriteKey = SpriteConstants.CheckYesSpriteKey; } diff --git a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs index 1f97e859c..6948c8f64 100644 --- a/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs +++ b/Assets/_DDD/_Scripts/GameUi/RestaurantManagementUi/TodayRestaurantStateUi/TodayCookwareSlotUiStrategy.cs @@ -17,9 +17,18 @@ public void Setup(ItemSlotUi ui, ItemViewModel model) return; } + string markSpriteKey = null; + if (RestaurantState.instance.ManagementState.IsTodayMenuMatched(ui.Model.Id)) + { + markSpriteKey = SpriteConstants.CheckYesSpriteKey; + } + else + { + markSpriteKey = SpriteConstants.CheckNoSpriteKey; + } ui.SetIcon(model.ItemSprite); ui.HideCountText(); - ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭 + ui.ShowMark(DataManager.Instance.GetSprite(markSpriteKey)); // TODO : 추후에 장비와 매칭 ui.SetButtonInteractable(true); } diff --git a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementStateSo.cs b/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementStateSo.cs index d4f6fb70a..1a30db65d 100644 --- a/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementStateSo.cs +++ b/Assets/_DDD/_Scripts/RestaurantState/FlowStates/RestaurantManagementStateSo.cs @@ -211,5 +211,15 @@ public bool IsCookwareMatched(string recipeId) { return _cookwareToRecipeIds.Values.Any(recipeHashSets => recipeHashSets.Contains(recipeId)); } + + public bool IsTodayMenuMatched(string cookwareId) + { + if (_cookwareToRecipeIds.TryGetValue(cookwareId, out var recipeSet)) + { + return recipeSet.Count > 0; + } + + return false; + } } } \ No newline at end of file