Пример #1
0
 internal Resistances(Arcane arcane,
     Fire fire,
     Frost frost,
     Holy holy,
     Nature nature,
     Shadow shadow)
 {
     Arcane = arcane;
     Fire = fire;
     Frost = frost;
     Holy = holy;
     Nature = nature;
     Shadow = shadow;
 }
Пример #2
0
        private static void LoadResistances(Stats stats, XmlNode searchResults)
        {
            //<resistances>
            //  <arcane petBonus="-1" value="5"/>
            //  <fire petBonus="-1" value="5"/>
            //  <frost petBonus="-1" value="5"/>
            //  <holy petBonus="-1" value="0"/>
            //  <nature petBonus="-1" value="5"/>
            //  <shadow petBonus="-1" value="5"/>
            //</resistances>
            XmlNode characterNode = searchResults.SelectSingleNode("characterTab/resistances");

            XmlNode arcaneNode = characterNode.SelectSingleNode("arcane");
            Res.Arcane arcane = new Res.Arcane(
                Convert.ToInt32(arcaneNode.Attributes["value"].Value));

            XmlNode fireNode = characterNode.SelectSingleNode("fire");
            Res.Fire fire = new Res.Fire(
                Convert.ToInt32(fireNode.Attributes["value"].Value));

            XmlNode frostNode = characterNode.SelectSingleNode("frost");
            Res.Frost frost = new Res.Frost(
                Convert.ToInt32(frostNode.Attributes["value"].Value));

            XmlNode holyNode = characterNode.SelectSingleNode("holy");
            Res.Holy holy = new Res.Holy(
                Convert.ToInt32(holyNode.Attributes["value"].Value));

            XmlNode natureNode = characterNode.SelectSingleNode("nature");
            Res.Nature nature = new Res.Nature(
                Convert.ToInt32(natureNode.Attributes["value"].Value));

            XmlNode shadowNode = characterNode.SelectSingleNode("shadow");
            Res.Shadow shadow = new Res.Shadow(
                Convert.ToInt32(shadowNode.Attributes["value"].Value));

            Resistances resistances = new Resistances(arcane,
                                                      fire,
                                                      frost,
                                                      holy,
                                                      nature,
                                                      shadow);

            stats.Resistances = resistances;
        }