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