public Merchendise GetMerchendise(string itemId) { Merchendise retMerch = null; foreach (var merch in merchendiseList) { if (merch.ItemId == itemId) { retMerch = merch; } } return(retMerch); }
public static double GetValueOfMerchendise(Merchendise merchendise) { if (merchendise is Book book) { Book b = (Book)merchendise; return(GetValueOfBook(book)); } if (merchendise is Amulet amulet) { Amulet a = (Amulet)merchendise; return(GetValueOfAmulet(amulet)); } else { return(0.0); } }
public void AddMerchandise(Merchendise merch) { merchendiseList.Add(merch); }