public List <string> removePilotsForTransfer(EmployeeTransfer et) { // Unless we're removing all the pilots, we have to save the pilot on the aircraft. string busyPilot = null; if (et.getPilots() < getNumbPilots() && aircraft != null && aircraft.hasPilot()) { // Remove the pilot from hired pilots busyPilot = aircraft.getPilot(); hiredPilots.Remove(busyPilot); } List <string> removedPilots = new List <string>(); for (int i = 0; i < et.getPilots(); i++) { string pilot = hiredPilots.Last.Value; hiredPilots.Remove(pilot); removedPilots.Add(pilot); occupiedLivingSpace--; } if (busyPilot != null) { // Restore the pilot to hired pilots hiredPilots.AddLast(busyPilot); } return(removedPilots); }
public void addPilotsForTransfer(EmployeeTransfer et, List <string> pilots) { if (et.getPilots() != pilots.Count) { Debug.Log("Something went wrong"); } foreach (string p in pilots) { this.addHiredPilot(p); occupiedLivingSpace++; } }
public List<string> removePilotsForTransfer(EmployeeTransfer et) { // Unless we're removing all the pilots, we have to save the pilot on the aircraft. string busyPilot = null; if (et.getPilots() < getNumbPilots() && aircraft != null && aircraft.hasPilot()) { // Remove the pilot from hired pilots busyPilot = aircraft.getPilot(); hiredPilots.Remove(busyPilot); } List<string> removedPilots = new List<string>(); for (int i = 0; i < et.getPilots(); i++) { string pilot = hiredPilots.Last.Value; hiredPilots.Remove(pilot); removedPilots.Add(pilot); occupiedLivingSpace--; } if (busyPilot != null) { // Restore the pilot to hired pilots hiredPilots.AddLast(busyPilot); } return removedPilots; }
public void addPilotsForTransfer(EmployeeTransfer et, List<string> pilots) { if (et.getPilots() != pilots.Count) Debug.Log("Something went wrong"); foreach (string p in pilots) { this.addHiredPilot(p); occupiedLivingSpace++; } }