コード例 #1
0
        private Potion process_pDC(PotionDC rp)
        {
            int    PI = rp.IDNumber;
            int    PC = rp.Cost;
            string PN = rp.Name;

            Potion.Potion_Type PTT = 0;
            switch (rp.PotionType)
            {
            case "Health":
                PTT = Potion.Potion_Type.Health;
                break;

            case "Repair":
                PTT = Potion.Potion_Type.Repair;
                break;
            }
            int PP = rp.PotionPotency;

            return(new Potion(PI, PC, PN, PTT, PP));
        }
コード例 #2
0
 private Potion process_pDC(PotionDC rp)
 {
     return new Potion(rp);
 }
コード例 #3
0
        private XmlNode fill_in_potion_node(XmlDocument rootDocument, XmlNode rootNode, PotionDC raw_potion)
        {
            XmlNode potion_id_node = rootDocument.CreateElement("Potion_ID");
            potion_id_node.InnerText = raw_potion.IDNumber.ToString();
            XmlNode potion_cost_node = rootDocument.CreateElement("Potion_Cost");
            potion_cost_node.InnerText = raw_potion.Cost.ToString();
            XmlNode potion_icon_node = rootDocument.CreateElement("Potion_Icon");
            potion_icon_node.InnerText = raw_potion.Icon;
            XmlNode potion_name_node = rootDocument.CreateElement("Potion_Name");
            potion_name_node.InnerText = raw_potion.Name;
            XmlNode potion_tier_node = rootDocument.CreateElement("Potion_Tier");
            potion_tier_node.InnerText = raw_potion.ItemTier.ToString();
            XmlNode potion_dungeons_node = rootDocument.CreateElement("Potion_Dungeons_Required");
            potion_dungeons_node.InnerText = raw_potion.DungeonsRequired.ToString();
            XmlNode potion_floors_node = rootDocument.CreateElement("Potion_Floors_Required");
            potion_floors_node.InnerText = raw_potion.FloorsRequired.ToString();
            XmlNode potion_classes_node = rootDocument.CreateElement("Potion_Valid_Classes");
            potion_classes_node.InnerText = raw_potion.ValidClasses;
            XmlNode potion_properties_node = rootDocument.CreateElement("Potion_Properties");
            List<string> raw_properties = raw_potion.ItemProperties;
            for (int i = 0; i < raw_properties.Count; i++)
            {
                XmlNode property_node = rootDocument.CreateElement("Item");
                property_node.InnerText = raw_properties[i];

                potion_properties_node.AppendChild(property_node);
            }
            XmlNode potion_talismans_node = rootDocument.CreateElement("Potion_Talismans");
            List<string> raw_talismans = raw_potion.Talismans;
            for (int i = 0; i < raw_talismans.Count; i++)
            {
                XmlNode talisman_node = rootDocument.CreateElement("Item");
                talisman_node.InnerText = raw_talismans[i];

                potion_talismans_node.AppendChild(talisman_node);
            }

            XmlNode potion_type_node = rootDocument.CreateElement("Potion_Type");
            potion_type_node.InnerText = raw_potion.PotionType;
            XmlNode potion_potency_node = rootDocument.CreateElement("Potion_Potency");
            potion_potency_node.InnerText = raw_potion.PotionPotency.ToString();
            XmlNode potion_code_node = rootDocument.CreateElement("Potion_Code");
            potion_code_node.InnerText = raw_potion.PotionCode.ToString();

            rootNode.AppendChild(potion_id_node);
            rootNode.AppendChild(potion_cost_node);
            rootNode.AppendChild(potion_icon_node);
            rootNode.AppendChild(potion_name_node);
            rootNode.AppendChild(potion_tier_node);
            rootNode.AppendChild(potion_dungeons_node);
            rootNode.AppendChild(potion_floors_node);
            rootNode.AppendChild(potion_classes_node);
            rootNode.AppendChild(potion_properties_node);
            rootNode.AppendChild(potion_talismans_node);

            rootNode.AppendChild(potion_type_node);
            rootNode.AppendChild(potion_potency_node);
            rootNode.AppendChild(potion_code_node);

            return rootNode;
        }