Esempio n. 1
0
 public void PurifyInfluenceKind(Person person, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.个人)
     {
         PurifyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingTroop t = new ApplyingTroop(person.LocationTroop, applier, applierID);
         if (person.LocationTroop != null && i.appliedTroop.Contains(t))
         {
             i.appliedTroop.RemoveWhere((a2) => { return(t.Equals(a2)); });
             PurifyInfluenceKind(person.LocationTroop, i, applier, applierID);
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingArchitecture t = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
         if (person.LocationTroop != null && i.appliedArch.Contains(t))
         {
             i.appliedArch.RemoveWhere((a2) => { return(t.Equals(a2)); });
             PurifyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
         }
     }
 }
Esempio n. 2
0
 public void ApplyInfluenceKind(Person person, Influence i, Applier applier, int applierID, bool excludePersonal)
 {
     if (this.Type == InfluenceType.个人 && !excludePersonal)
     {
         ApplyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         if (person.LocationTroop != null)
         {
             ApplyingTroop z = new ApplyingTroop(person.LocationTroop, applier, applierID);
             if (!i.appliedTroop.Contains(z))
             {
                 i.appliedTroop.Add(z);
                 person.LocationTroop.InfluencesApplying.Add(i);
                 ApplyInfluenceKind(person.LocationTroop, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         if (person.LocationArchitecture != null)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
             }
         }
     }
 }
Esempio n. 3
0
 public void PurifyInfluenceKind(Person person, Influence i, Applier applier, int applierID, bool excludePersonal)
 {
     if (this.Type == InfluenceType.个人 && !excludePersonal)
     {
         PurifyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingTroop t = new ApplyingTroop(person.LocationTroop, applier, applierID);
         if (person.LocationTroop != null && i.appliedTroop.Contains(t))
         {
             i.appliedTroop.Remove(t);
             PurifyInfluenceKind(person.LocationTroop, i, applier, applierID);
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingArchitecture t = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
         if (person.LocationTroop != null && i.appliedArch.Contains(t))
         {
             i.appliedArch.Remove(t);
             PurifyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
         }
     }
 }
Esempio n. 4
0
 public void ApplyInfluenceKind(Faction faction, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.势力)
     {
         ApplyInfluenceKind(faction);
         foreach (Architecture a in faction.Architectures)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(a, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(a, i, applier, applierID);
             }
         }
         foreach (Troop t in faction.Troops)
         {
             ApplyingTroop a = new ApplyingTroop(t, applier, applierID);
             if (!i.appliedTroop.Contains(a))
             {
                 i.appliedTroop.Add(a);
                 ApplyInfluenceKind(t, i, applier, applierID);
             }
         }
     }
 }
        public void ApplyInfluenceKind(Person person, Influence i, Applier applier, int applierID)
        {
            ApplyInfluenceKind(person);
            ApplyingTroop z = new ApplyingTroop(person.LocationTroop, applier, applierID);

            if (person.LocationTroop != null && !i.appliedTroop.Contains(z))
            {
                i.appliedTroop.Add(z);
                ApplyInfluenceKind(person.LocationTroop, i, applier, applierID);
            }
        }
        public void PurifyInfluenceKind(Person person, Influence i, Applier applier, int applierID)
        {
            PurifyInfluenceKind(person);
            ApplyingTroop t = new ApplyingTroop(person.LocationTroop, applier, applierID);

            if (person.LocationTroop != null && i.appliedTroop.Contains(t))
            {
                i.appliedTroop.RemoveWhere((a2) => { return(t.Equals(a2)); });
                PurifyInfluenceKind(person.LocationTroop, i, applier, applierID);
            }
        }
Esempio n. 7
0
        public void ApplyInfluence(Troop troop, Applier applier, int applierID)
        {
            ApplyingTroop a = new ApplyingTroop(troop, applier, applierID);

            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.ApplyInfluenceKind(troop, this, applier, applierID);
            }
            catch
            {
            }
        }
Esempio n. 8
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is ApplyingTroop))
            {
                return(false);
            }
            ApplyingTroop a = (ApplyingTroop)obj;

            return(a.applierID == this.applierID && a.applier.Equals(this.applier) && a.troop.Equals(this.troop));
        }
Esempio n. 9
0
 public void ApplyInfluence(Troop troop, Applier applier, int applierID)
 {
     ApplyingTroop a = new ApplyingTroop(troop, applier, applierID);
     if (appliedTroop.Contains(a) && (this.ID < 390 || this.ID > 399 && (this.ID != 720 && this.ID != 721))) return;
     appliedTroop.Add(a);
     troop.InfluencesApplying.Add(this);
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     try
     {
         this.Kind.ApplyInfluenceKind(troop, this, applier, applierID);
     }
     catch
     {
     }
 }
Esempio n. 10
0
 public void ApplyInfluenceKind(Faction faction, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.势力)
     {
         ApplyInfluenceKind(faction);
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         foreach (Architecture a in faction.Architectures)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(a, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(a, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         foreach (Troop t in faction.Troops)
         {
             ApplyingTroop a = new ApplyingTroop(t, applier, applierID);
             if (!i.appliedTroop.Contains(a))
             {
                 i.appliedTroop.Add(a);
                 t.InfluencesApplying.Add(i);
                 ApplyInfluenceKind(t, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.个人)
     {
         foreach (Person p in faction.Persons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
     }
 }
Esempio n. 11
0
        public void ApplyInfluence(Troop troop, Applier applier, int applierID)
        {
            ApplyingTroop a = new ApplyingTroop(troop, applier, applierID);

            if (appliedTroop.Contains(a) && (this.ID < 390 || this.ID > 399))
            {
                return;
            }
            appliedTroop.Add(a);
            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.ApplyInfluenceKind(troop, this, applier, applierID);
            }
            catch
            {
            }
        }
Esempio n. 12
0
        public void PurifyInfluence(Troop troop, Applier applier, int applierID)
        {
            ApplyingTroop a = new ApplyingTroop(troop, applier, applierID);

            if (!appliedTroop.Contains(a))
            {
                return;
            }
            appliedTroop.Remove(a);
            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.PurifyInfluenceKind(troop, this, applier, applierID);
            }
            catch
            {
            }
        }
Esempio n. 13
0
 public void PurifyInfluence(Troop troop, Applier applier, int applierID)
 {
     ApplyingTroop a = new ApplyingTroop(troop, applier, applierID);
     if (!appliedTroop.Contains(a)) return;
     appliedTroop.RemoveWhere((x) => { return x.Equals(a) || x.troop.Destroyed; });
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     try
     {
         this.Kind.PurifyInfluenceKind(troop, this, applier, applierID);
     }
     catch
     {
     }
 }
Esempio n. 14
0
 public void ApplyInfluenceKind(Faction faction, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.势力)
     {
         ApplyInfluenceKind(faction);
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         foreach (Architecture a in faction.Architectures)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(a, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(a, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         foreach (Troop t in faction.Troops)
         {
             ApplyingTroop a = new ApplyingTroop(t, applier, applierID);
             if (!i.appliedTroop.Contains(a))
             {
                 i.appliedTroop.Add(a);
                 t.InfluencesApplying.Add(i);
                 ApplyInfluenceKind(t, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.个人)
     {
         foreach (Person p in faction.Persons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
     }
 }
Esempio n. 15
0
 public void PurifyInfluenceKind(Person person, Influence i, Applier applier, int applierID, bool excludePersonal)
 {
     if (this.Type == InfluenceType.个人 && !excludePersonal)
     {
         PurifyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingTroop t = new ApplyingTroop(person.LocationTroop, applier, applierID);
         if (person.LocationTroop != null && i.appliedTroop.Contains(t))
         {
             i.appliedTroop.Remove(t);
             PurifyInfluenceKind(person.LocationTroop, i, applier, applierID);
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingArchitecture t = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
         if (person.LocationTroop != null && i.appliedArch.Contains(t))
         {
             i.appliedArch.Remove(t);
             PurifyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
         }
     }
 }
Esempio n. 16
0
 public void ApplyInfluenceKind(Person person, Influence i, Applier applier, int applierID, bool excludePersonal)
 {
     if (this.Type == InfluenceType.个人 && !excludePersonal)
     {
         ApplyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         if (person.LocationTroop != null)
         {
             ApplyingTroop z = new ApplyingTroop(person.LocationTroop, applier, applierID);
             if (!i.appliedTroop.Contains(z))
             {
                 i.appliedTroop.Add(z);
                 person.LocationTroop.InfluencesApplying.Add(i);
                 ApplyInfluenceKind(person.LocationTroop, i, applier, applierID);
             }
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         if (person.LocationArchitecture != null)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
             }
         }
     }
 }
Esempio n. 17
0
 public void ApplyInfluenceKind(Faction faction, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.势力)
     {
         ApplyInfluenceKind(faction);
         foreach (Architecture a in faction.Architectures)
         {
             ApplyingArchitecture z = new ApplyingArchitecture(a, applier, applierID);
             if (!i.appliedArch.Contains(z))
             {
                 i.appliedArch.Add(z);
                 ApplyInfluenceKind(a, i, applier, applierID);
             }
         }
         foreach (Troop t in faction.Troops)
         {
             ApplyingTroop a = new ApplyingTroop(t, applier, applierID);
             if (!i.appliedTroop.Contains(a))
             {
                 i.appliedTroop.Add(a);
                 ApplyInfluenceKind(t, i, applier, applierID);
             }
         }
     }
 }
Esempio n. 18
0
 public void PurifyInfluenceKind(Person person, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.个人)
     {
         PurifyInfluenceKind(person);
     }
     if (this.Type == InfluenceType.战斗 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingTroop t = new ApplyingTroop(person.LocationTroop, applier, applierID);
         if (person.LocationTroop != null && i.appliedTroop.Contains(t))
         {
             i.appliedTroop.RemoveWhere((a2) => { return t.Equals(a2); });
             PurifyInfluenceKind(person.LocationTroop, i, applier, applierID);
         }
     }
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyingArchitecture t = new ApplyingArchitecture(person.LocationArchitecture, applier, applierID);
         if (person.LocationTroop != null && i.appliedArch.Contains(t))
         {
             i.appliedArch.RemoveWhere((a2) => { return t.Equals(a2); });
             PurifyInfluenceKind(person.LocationArchitecture, i, applier, applierID);
         }
     }
 }