요리 state 기능 추가

This commit is contained in:
NTG 2025-08-29 19:01:27 +09:00
parent de32443df9
commit d0c799f177

View File

@ -259,5 +259,22 @@ public bool HasAddedCookByCookwareKey(string cookwareKey)
{ {
return _cookwareToRecipeIds.ContainsKey(cookwareKey) && _cookwareToRecipeIds[cookwareKey].Count > 0;; 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;
}
} }
} }