예제 #1
0
 private void SetDamageType(Types.Damage damageType, bool setPresent)
 {
     if (setPresent)
     {
         _descriptors.Add(damageType);
     }
     else
     {
         _descriptors.Remove(damageType);
     }
 }
예제 #2
0
 public void ReadXML(XmlNode xmlNode)
 {
     try
     {
         foreach (XmlNode childNode in xmlNode.ChildNodes)
         {
             if (childNode.Name == "Value")
             {
                 Value = Convert.ToInt32(childNode.InnerText);
             }
             else if (childNode.Name == "EnergyType")
             {
                 EnergyType = Methods.GetDamageTypeFromString(childNode.InnerText);
             }
         }
     }
     catch (XmlException e)
     {
         MessageBox.Show(e.ToString());
     }
 }
        public void SetEnergyType(Types.Damage energyType)
        {
            switch (energyType)
            {
            case Types.Damage.Acid:                                         Acid = true; break;

            case Types.Damage.Cold:                                         Cold = true; break;

            case Types.Damage.Electricity:          Electricity = true; break;

            case Types.Damage.Fire:                                         Fire = true; break;

            case Types.Damage.Force:                                        Force = true; break;

            case Types.Damage.NegativeEnergy: NegativeEnergy = true; break;

            case Types.Damage.PositiveEnergy: PositiveEnergy = true; break;

            case Types.Damage.Sonic:                                        Sonic = true; break;
            }
        }
예제 #4
0
 public bool Contains(Types.Damage damageType)
 {
     return(_descriptors.Contains(damageType));
 }
예제 #5
0
 public void Add(Types.Damage damageType)
 {
     SetDamageType(damageType, true);
 }