요리도구-오늘의메뉴 매칭 기능 추가
This commit is contained in:
parent
fbe003c0c2
commit
3099961e65
@ -14,8 +14,6 @@ public TodayMenuSlotUiStrategy(RecipeType recipeType)
|
|||||||
|
|
||||||
public void Setup(ItemSlotUi ui, ItemViewModel model)
|
public void Setup(ItemSlotUi ui, ItemViewModel model)
|
||||||
{
|
{
|
||||||
var restaurantManagementStateSo = RestaurantState.instance.ManagementState;
|
|
||||||
|
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
string emptySpriteKey = null;
|
string emptySpriteKey = null;
|
||||||
@ -37,7 +35,7 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string markSpriteKey = null;
|
string markSpriteKey = null;
|
||||||
if (restaurantManagementStateSo.IsCookwareMatched(ui.Model.Id))
|
if (RestaurantState.instance.ManagementState.IsCookwareMatched(ui.Model.Id))
|
||||||
{
|
{
|
||||||
markSpriteKey = SpriteConstants.CheckYesSpriteKey;
|
markSpriteKey = SpriteConstants.CheckYesSpriteKey;
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,18 @@ public void Setup(ItemSlotUi ui, ItemViewModel model)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string markSpriteKey = null;
|
||||||
|
if (RestaurantState.instance.ManagementState.IsTodayMenuMatched(ui.Model.Id))
|
||||||
|
{
|
||||||
|
markSpriteKey = SpriteConstants.CheckYesSpriteKey;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
markSpriteKey = SpriteConstants.CheckNoSpriteKey;
|
||||||
|
}
|
||||||
ui.SetIcon(model.ItemSprite);
|
ui.SetIcon(model.ItemSprite);
|
||||||
ui.HideCountText();
|
ui.HideCountText();
|
||||||
ui.ShowMark(DataManager.Instance.GetSprite(SpriteConstants.CheckNoSpriteKey)); // TODO : 추후에 장비와 매칭
|
ui.ShowMark(DataManager.Instance.GetSprite(markSpriteKey)); // TODO : 추후에 장비와 매칭
|
||||||
ui.SetButtonInteractable(true);
|
ui.SetButtonInteractable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,5 +211,15 @@ public bool IsCookwareMatched(string recipeId)
|
|||||||
{
|
{
|
||||||
return _cookwareToRecipeIds.Values.Any(recipeHashSets => recipeHashSets.Contains(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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user