public void UsePotion() { var obj = Pinventory.Where(p => p.Name == "Potion"); foreach (Potions item in obj) { if (item.Name == "Potion") { Pinventory.Remove(item); Console.WriteLine($"Using a Potion"); Console.SetCursorPosition(2, 13); Console.WriteLine($"You have { obj.Count()} Potions left"); this.HP = this.MaxHP; break; } else { Console.WriteLine("No Potions in your inventory!"); } } }
public void AddInventory(Items item) { Pinventory.Add(item); }
public void RemoveInventory(Items item) { Pinventory.Remove(item); }
public int PotionsInInventory() { var obj = Pinventory.Where(p => p.Name == "Potion"); return(obj.Count()); }