diff --git a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs index 72747e35b..63c8bdc06 100644 --- a/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs +++ b/Assets/_DDD/_Scripts/Restaurant/State/FlowStates/RestaurantManagementState.cs @@ -259,5 +259,22 @@ public bool HasAddedCookByCookwareKey(string cookwareKey) { return _cookwareToRecipeIds.ContainsKey(cookwareKey) && _cookwareToRecipeIds[cookwareKey].Count > 0;; } + + public bool TryCookingById(string recipeId) + { + if (_todayFoodRecipeIds.TryGetValue(recipeId, out var foodCount) && foodCount > 0) + { + _todayFoodRecipeIds[recipeId] -= 1; + return true; + } + + if (_todayDrinkRecipeIds.TryGetValue(recipeId, out var drinkCount) && drinkCount > 0) + { + _todayDrinkRecipeIds[recipeId] -= 1; + return true; + } + + return false; + } } } \ No newline at end of file