예제 #1
0
 public void Release(Pawn claimant, Job job, IAttackTarget target)
 {
     if (target == null)
     {
         Log.Warning(claimant + " tried to release reservation on null attack target.", false);
         return;
     }
     for (int i = 0; i < this.reservations.Count; i++)
     {
         AttackTargetReservationManager.AttackTargetReservation attackTargetReservation = this.reservations[i];
         if (attackTargetReservation.target == target && attackTargetReservation.claimant == claimant && attackTargetReservation.job == job)
         {
             this.reservations.RemoveAt(i);
             return;
         }
     }
     Log.Warning(string.Concat(new object[]
     {
         claimant,
         " with job ",
         job,
         " tried to release reservation on target ",
         target,
         ", but it's not reserved by him."
     }), false);
 }
예제 #2
0
 public bool IsReservedBy(Pawn claimant, IAttackTarget target)
 {
     for (int i = 0; i < this.reservations.Count; i++)
     {
         AttackTargetReservationManager.AttackTargetReservation attackTargetReservation = this.reservations[i];
         if (attackTargetReservation.target == target && attackTargetReservation.claimant == claimant)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #3
0
        private int GetReservationsCount(IAttackTarget target, Faction faction)
        {
            int num = 0;

            for (int i = 0; i < this.reservations.Count; i++)
            {
                AttackTargetReservationManager.AttackTargetReservation attackTargetReservation = this.reservations[i];
                if (attackTargetReservation.target == target && attackTargetReservation.claimant.Faction == faction)
                {
                    num++;
                }
            }
            return(num);
        }
예제 #4
0
 public void Reserve(Pawn claimant, Job job, IAttackTarget target)
 {
     if (target == null)
     {
         Log.Warning(claimant + " tried to reserve null attack target.", false);
     }
     else if (!this.IsReservedBy(claimant, target))
     {
         AttackTargetReservationManager.AttackTargetReservation attackTargetReservation = new AttackTargetReservationManager.AttackTargetReservation();
         attackTargetReservation.target   = target;
         attackTargetReservation.claimant = claimant;
         attackTargetReservation.job      = job;
         this.reservations.Add(attackTargetReservation);
     }
 }
예제 #5
0
 internal bool <> m__0(AttackTargetReservationManager.AttackTargetReservation x)
 {
     return(x.target == this.target);
 }
예제 #6
0
 private static bool <ExposeData> m__1(AttackTargetReservationManager.AttackTargetReservation x)
 {
     return(x.claimant.DestroyedOrNull());
 }
예제 #7
0
 private static bool <ExposeData> m__0(AttackTargetReservationManager.AttackTargetReservation x)
 {
     return(x.target == null);
 }