public void removeOrUsePotion(Item Potion) { if (Potion is PotionLife) { PotionLife p = Potion as PotionLife; inventoryPotionLife.Remove(p); } else if (Potion is PotionMana) { PotionMana p = Potion as PotionMana; inventoryPotionMana.Remove(p); } }
public Boolean AddPotion(Item Potion) { if (Potion is PotionLife) { PotionLife p = Potion as PotionLife; inventoryPotionLife.Add(p); return(true); } else if (Potion is PotionMana) { PotionMana p = Potion as PotionMana; inventoryPotionMana.Add(p); return(true); } return(false); }