public void AddPotion(Potions NewPotion) { Potions Potion = new Potions(); Potion.Name = NewPotion.Name; Potion.DiceNum = NewPotion.DiceNum; Potion.DiceSize = NewPotion.DiceSize; Potion.Modifier = NewPotion.Modifier; Potion.Cost = NewPotion.Cost; PotionStock.Add(Potion); }
static void LoadPotions(XmlNode Node) { int ChildCount = Convert.ToInt32(Node.Attributes[0].Value); int Count = 0; Potions[] PotTemp = new Potions[ChildCount]; foreach (XmlNode Child in Node.ChildNodes) { PotTemp[Count] = new Potions(); PotTemp[Count].Name = Child.Attributes[0].Value; PotTemp[Count].DiceNum = Convert.ToInt32(Child.Attributes[1].Value); PotTemp[Count].DiceSize = Convert.ToInt32(Child.Attributes[2].Value); PotTemp[Count].Modifier = Convert.ToInt32(Child.Attributes[3].Value); PotTemp[Count].Cost = Convert.ToInt32(Child.Attributes[4].Value); Count += 1; } foreach (Potions Potion in PotTemp) { Potions.Add(Potion); } }