public void LoadEffectPersonFromString(Dictionary<int, Person> persons, EventEffectTable eventEffects, string data) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.EffectPersons.Clear(); for (int i = 0; i < strArray.Length; i += 2) { if (!persons.ContainsKey(int.Parse(strArray[i]))) continue; TroopEffectPerson item = new TroopEffectPerson(); item.EffectPerson = persons[int.Parse(strArray[i])]; item.Effect = eventEffects.GetEventEffect(int.Parse(strArray[i + 1])); this.EffectPersons.Add(item); } }
public void LoadSelfEffectFromString(EventEffectTable eventEffects, string data) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.SelfEffects.Clear(); for (int i = 0; i < strArray.Length; i++) { GameObjects.TroopDetail.EventEffect.EventEffect eventEffect = eventEffects.GetEventEffect(int.Parse(strArray[i])); if (eventEffect != null) { this.SelfEffects.Add(eventEffect); } } }
public void LoadEffectAreaFromString(EventEffectTable eventEffects, string data) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = data.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.EffectAreas.Clear(); for (int i = 0; i < strArray.Length; i += 2) { TroopEffectArea item = new TroopEffectArea(); item.Kind = (EffectAreaKind) int.Parse(strArray[i]); item.Effect = eventEffects.GetEventEffect(int.Parse(strArray[i + 1])); this.EffectAreas.Add(item); } }