private void SetDamageType(Types.Damage damageType, bool setPresent) { if (setPresent) { _descriptors.Add(damageType); } else { _descriptors.Remove(damageType); } }
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; } }
public bool Contains(Types.Damage damageType) { return(_descriptors.Contains(damageType)); }
public void Add(Types.Damage damageType) { SetDamageType(damageType, true); }