상점 UI 포션 MVP 패턴 추가
This commit is contained in:
@@ -44,21 +44,21 @@ namespace TON
|
||||
}
|
||||
|
||||
// 포션 구매 메서드
|
||||
private void BuyPotion(int price, string potionType, int quantity)
|
||||
public void BuyPotion(ShopItemPresenter shopItem)
|
||||
{
|
||||
if (playerDataManager.goldAmount >= price)
|
||||
if (playerDataManager.goldAmount >= shopItem.Price.Value)
|
||||
{
|
||||
playerDataManager.UseGold(price, (isSuccess) =>
|
||||
playerDataManager.UseGold(shopItem.Price.Value, (isSuccess) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
if (potionType == "hp")
|
||||
if (shopItem.PotionType.Value == "hp")
|
||||
{
|
||||
playerDataManager.AddPotion("HP", quantity);
|
||||
playerDataManager.AddPotion("HP", shopItem.Quantity.Value);
|
||||
}
|
||||
else if (potionType == "mp")
|
||||
else if (shopItem.PotionType.Value == "mp")
|
||||
{
|
||||
playerDataManager.AddPotion("MP", quantity);
|
||||
playerDataManager.AddPotion("MP", shopItem.Quantity.Value);
|
||||
}
|
||||
|
||||
UIManager.Singleton.UpdateCashData();
|
||||
|
||||
Reference in New Issue
Block a user