protected void ReturnItem(ShopList.ItemInfo itemData) { if (Contains(itemData)) { Get(itemData).RemoveQuantity(1); UpdateGrandTotal(); } }
public override void AddItem(ShopList.ItemInfo itemData) { if (!Contains(itemData)) { Shop.CreateUpgradeItem(items). SetItem(Inventory.CreateItem(itemData.itemCode), itemData.price, 1). SetAction(() => ReturnItem(itemData)); } UpdateGrandTotal(); }
private void MoveToBasket(ShopList.ItemInfo itemData) { if (!basket.Contains(itemData)) { basket.AddItem(itemData); } else { GameLibOfMethods.CreateFloatingText("You already ordered this.", 1.5f); } }
public virtual void AddItem(ShopList.ItemInfo itemData) { if (Contains(itemData)) { Get(itemData).AddQuantity(1); } else { Shop.CreateBasketItem(items). SetItem(Inventory.CreateItem(itemData.itemCode), itemData.price, 1). SetAction(() => ReturnItem(itemData)); } UpdateGrandTotal(); }
private void MoveToBasket(ShopList.ItemInfo itemData) { basket.AddItem(itemData); }
protected BasketItem Get(ShopList.ItemInfo itemData) { return(GetCurrentItems().Find(bItem => bItem.itemCode == itemData.itemCode)); }
public bool Contains(ShopList.ItemInfo itemData) { return(GetCurrentItems().Exists(bItem => bItem.itemCode == itemData.itemCode)); }