Exemplo n.º 1
0
        private Item BuildItemObject(XmlNode itemNode)
        {
            Item item;

            switch (itemNode.Attributes[0].Value)
            {
            case "Key":
                item = Key.BuildFromXmlNode(itemNode); break;

            case "Text":
                item = Text.BuildFromXmlNode(itemNode); break;

            case "Potion":
                item = Potion.BuildFromXmlNode(itemNode); break;

            case "DamageAmplifier":
                item = DamageAmplifier.BuildFromXmlNode(itemNode); break;

            default:
                throw new Exception("Item build failed - No type");
            }
            ItemAddSpawnItems(item, itemNode);
            return(item);
        }