요리 state 기능 추가
This commit is contained in:
parent
de32443df9
commit
d0c799f177
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user