public Pawn FirstReserverOf(LocalTargetInfo target) { for (int i = 0; i < this.reservations.Count; i++) { PhysicalInteractionReservationManager.PhysicalInteractionReservation physicalInteractionReservation = this.reservations[i]; if (physicalInteractionReservation.target == target) { return(physicalInteractionReservation.claimant); } } return(null); }
public bool IsReservedBy(Pawn claimant, LocalTargetInfo target) { for (int i = 0; i < this.reservations.Count; i++) { PhysicalInteractionReservationManager.PhysicalInteractionReservation physicalInteractionReservation = this.reservations[i]; if (physicalInteractionReservation.target == target && physicalInteractionReservation.claimant == claimant) { return(true); } } return(false); }
public void Reserve(Pawn claimant, Job job, LocalTargetInfo target) { if (this.IsReservedBy(claimant, target)) { return; } PhysicalInteractionReservationManager.PhysicalInteractionReservation physicalInteractionReservation = new PhysicalInteractionReservationManager.PhysicalInteractionReservation(); physicalInteractionReservation.target = target; physicalInteractionReservation.claimant = claimant; physicalInteractionReservation.job = job; this.reservations.Add(physicalInteractionReservation); }
public void Release(Pawn claimant, Job job, LocalTargetInfo target) { for (int i = 0; i < this.reservations.Count; i++) { PhysicalInteractionReservationManager.PhysicalInteractionReservation physicalInteractionReservation = this.reservations[i]; if (physicalInteractionReservation.target == target && physicalInteractionReservation.claimant == claimant && physicalInteractionReservation.job == job) { this.reservations.RemoveAt(i); return; } } Log.Warning(string.Concat(new object[] { claimant, " tried to release reservation on target ", target, ", but it's not reserved by him." }), false); }
internal bool <> m__0(PhysicalInteractionReservationManager.PhysicalInteractionReservation x) { return(x.target == this.target); }
private static bool <ExposeData> m__0(PhysicalInteractionReservationManager.PhysicalInteractionReservation x) { return(x.claimant.DestroyedOrNull()); }