Beispiel #1
0
 public void ApplyInfluenceKind(Architecture architecture, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyInfluenceKind(architecture);
     }
     else if (this.Type == InfluenceType.个人)
     {
         foreach (Person p in architecture.Persons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
         foreach (Person p in architecture.MovingPersons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
     }
 }
 public void ApplyInfluenceKind(Architecture architecture, Influence i, Applier applier, int applierID)
 {
     if (this.Type == InfluenceType.建筑 || this.Type == InfluenceType.建筑战斗)
     {
         ApplyInfluenceKind(architecture);
     } 
     else if (this.Type == InfluenceType.个人)
     {
         foreach (Person p in architecture.Persons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
         foreach (Person p in architecture.MovingPersons)
         {
             ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
             if (!i.appliedPerson.Contains(a))
             {
                 i.appliedPerson.Add(a);
                 ApplyInfluenceKind(p, i, applier, applierID, false);
             }
         }
     }
 }
 public void ApplyInfluenceKind(Architecture architecture, Influence i, Applier applier, int applierID)
 {
     ApplyInfluenceKind(architecture);
     foreach (Person p in architecture.Persons)
     {
         ApplyingPerson a = new ApplyingPerson(p, applier, applierID);
         if (!i.appliedPerson.Contains(a))
         {
             i.appliedPerson.Add(a);
             ApplyInfluenceKind(p, i, applier, applierID);
         }
     }
 }
Beispiel #4
0
        public void ApplyInfluence(Person person, Applier applier, int applierID, bool excludePersonal)
        {
            ApplyingPerson a = new ApplyingPerson(person, applier, applierID);

            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.ApplyInfluenceKind(person, this, applier, applierID, excludePersonal);
            }
            catch
            {
            }
        }
Beispiel #5
0
 public void ApplyInfluence(Person person, Applier applier, int applierID, bool excludePersonal)
 {
     ApplyingPerson a = new ApplyingPerson(person, applier, applierID);
     if (appliedPerson.Contains(a) && 
         (person.LocationTroop == null || appliedTroop.Contains(new ApplyingTroop(person.LocationTroop, applier, applierID)) 
             || this.Type != InfluenceType.战斗)) return;
     appliedPerson.Add(a);
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     try
     {
         this.Kind.ApplyInfluenceKind(person, this, applier, applierID, excludePersonal);
     }
     catch
     {
     }
 }
Beispiel #6
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);
             }
         }
     }
 }
Beispiel #7
0
        public void PurifyInfluence(Person person, Applier applier, int applierID, bool excludePersonal)
        {
            ApplyingPerson a = new ApplyingPerson(person, applier, applierID);

            if (!appliedPerson.Contains(a))
            {
                return;
            }
            appliedPerson.Remove(a);
            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.PurifyInfluenceKind(person, this, applier, applierID, excludePersonal);
            }
            catch
            {
            }
        }
Beispiel #8
0
        public void PurifyInfluence(Person person, Applier applier, int applierID)
        {
            ApplyingPerson a = new ApplyingPerson(person, applier, applierID);

            if (!appliedPerson.Contains(a))
            {
                return;
            }
            appliedPerson.RemoveWhere((x) => { return(x.Equals(a)); });
            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.PurifyInfluenceKind(person, this, applier, applierID);
            }
            catch
            {
            }
        }
Beispiel #9
0
        public void ApplyInfluence(Person person, Applier applier, int applierID, bool excludePersonal)
        {
            ApplyingPerson a = new ApplyingPerson(person, applier, applierID);

            if (appliedPerson.Contains(a) &&
                (person.LocationTroop == null || appliedTroop.Contains(new ApplyingTroop(person.LocationTroop, applier, applierID)) ||
                 this.Type != InfluenceType.战斗))
            {
                return;
            }
            appliedPerson.Add(a);
            this.Kind.InitializeParameter(this.Parameter);
            this.Kind.InitializeParameter2(this.Parameter2);
            try
            {
                this.Kind.ApplyInfluenceKind(person, this, applier, applierID, excludePersonal);
            }
            catch
            {
            }
        }
Beispiel #10
0
 public void PurifyInfluence(Person person, Applier applier, int applierID)
 {
     ApplyingPerson a = new ApplyingPerson(person, applier, applierID);
     if (!appliedPerson.Contains(a)) return;
     appliedPerson.RemoveWhere((x) => { return x.Equals(a); });
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     try
     {
         this.Kind.PurifyInfluenceKind(person, this, applier, applierID);
     }
     catch
     {
     }
 }
 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);
             }
         }
     }
 }
Beispiel #12
0
 public void PurifyInfluence(Person person, Applier applier, int applierID, bool excludePersonal)
 {
     ApplyingPerson a = new ApplyingPerson(person, applier, applierID);
     if (!appliedPerson.Contains(a)) return;
     appliedPerson.Remove(a);
     this.Kind.InitializeParameter(this.Parameter);
     this.Kind.InitializeParameter2(this.Parameter2);
     try
     {
         this.Kind.PurifyInfluenceKind(person, this, applier, applierID, excludePersonal);
     }
     catch
     {
     }
 }