Esempio n. 1
0
 public void LoadFromString(EventEffectTable allEventEffects, string influenceIDs)
 {
     char[]   separator = new char[] { ' ', '\n', '\r' };
     string[] strArray  = influenceIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     GameObjects.TroopDetail.EventEffect.EventEffect effect = null;
     for (int i = 0; i < strArray.Length; i++)
     {
         if (allEventEffects.EventEffects.TryGetValue(int.Parse(strArray[i]), out effect))
         {
             this.AddEventEffect(effect);
         }
     }
 }
 public void LoadFromString(EventEffectTable allEventEffects, string influenceIDs)
 {
     char[] separator = new char[] { ' ', '\n', '\r', '\t' };
     string[] strArray = influenceIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries);
     GameObjects.TroopDetail.EventEffect.EventEffect effect = null;
     for (int i = 0; i < strArray.Length; i++)
     {
         if (allEventEffects.EventEffects.TryGetValue(int.Parse(strArray[i]), out effect))
         {
             this.AddEventEffect(effect);
         }
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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);
         }
     }
 }
Esempio n. 5
0
 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);
     }
 }