public int CheckDestroyState(int life) { for (int i = _effects.Count - 1; i > -1; i--) { DEffectModel eff = _effects[i]; if (eff._life >= life) { return(eff._id); } } return(0); }
public int CheckDestroyState(int life) { for (int index = this._effects.Count - 1; index > -1; --index) { DEffectModel effect = this._effects[index]; if (effect._life >= life) { return(effect._id); } } return(0); }
private static void DEffectsXML(XmlNode xmlNode, ObjModel obj) { for (XmlNode xmlNode1 = xmlNode.FirstChild; xmlNode1 != null; xmlNode1 = xmlNode1.NextSibling) { if ("DestroyEffects".Equals(xmlNode1.Name)) { for (XmlNode xmlNode2 = xmlNode1.FirstChild; xmlNode2 != null; xmlNode2 = xmlNode2.NextSibling) { if ("Effect".Equals(xmlNode2.Name)) { XmlNamedNodeMap attributes = (XmlNamedNodeMap)xmlNode2.Attributes; DEffectModel deffectModel = new DEffectModel() { _id = int.Parse(attributes.GetNamedItem("Id").Value), _life = int.Parse(attributes.GetNamedItem("Percent").Value) }; obj._effects.Add(deffectModel); } } } } }
private static void DEffectsXML(XmlNode xmlNode, ObjModel obj) { for (XmlNode xmlNode5 = xmlNode.FirstChild; xmlNode5 != null; xmlNode5 = xmlNode5.NextSibling) { if ("DestroyEffects".Equals(xmlNode5.Name)) { for (XmlNode xmlNode6 = xmlNode5.FirstChild; xmlNode6 != null; xmlNode6 = xmlNode6.NextSibling) { if ("Effect".Equals(xmlNode6.Name)) { XmlNamedNodeMap xml6 = xmlNode6.Attributes; DEffectModel anim = new DEffectModel { _id = int.Parse(xml6.GetNamedItem("Id").Value), _life = int.Parse(xml6.GetNamedItem("Percent").Value) }; obj._effects.Add(anim); } } } } }