From d0c799f1770988c034459922f4ff7e65ea9e19b0 Mon Sep 17 00:00:00 2001 From: NTG Date: Fri, 29 Aug 2025 19:01:27 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=94=EB=A6=AC=20state=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FlowStates/RestaurantManagementState.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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