private void CheckIfPrisonerIsAloneWithPassengers(IBoardingArea boardingArea) { var prisonerIsAlone = boardingArea.GetBoardingAreaManager().PrisonerIsPresent() && !boardingArea.GetBoardingAreaManager().CoopIsPresent() && boardingArea.GetBoardingAreaManager().CountPassengers() > 1; if (prisonerIsAlone) { AddError(ErrorMessages.PrisonerNotAloneWithPassengers); } }
private void CheckIfFlightOfficerIsNotAloneWithCabinChief(IBoardingArea boardingArea) { var thereAreNotFlightOfficers = boardingArea.GetBoardingAreaManager().CountFlightOfficers() == 0; var thereAreMoreThanTwoPeople = boardingArea.GetBoardingAreaManager().CountPassengers() > 2; var FlightOfficersNotAlone = thereAreMoreThanTwoPeople || thereAreNotFlightOfficers || !boardingArea.GetBoardingAreaManager().CabinChiefIsPresent(); if (!FlightOfficersNotAlone) { AddError(ErrorMessages.FlightOfficersNotAloneWithCabinChief); } }
private void CheckIfStewardessIsNotAloneWithPilot(IBoardingArea boardingArea) { var thereAreNotStewardess = boardingArea.GetBoardingAreaManager().CountStewardesses() == 0; var thereAreMoreThanTwoPeople = boardingArea.GetBoardingAreaManager().CountPassengers() > 2; var stewardessIsAlone = thereAreMoreThanTwoPeople || thereAreNotStewardess || !boardingArea.GetBoardingAreaManager().PilotIsPresent(); if (!stewardessIsAlone) { AddError(ErrorMessages.StewardessesNotAloneWithPilot); } }
public void GoToDepartureGate() { if (DriverIsNotPresent()) { return; } _departurGate.GetBoardingAreaManager().AddPassengers(_boardingAreaManager.GetPassengers().ToList()); _boardingAreaManager.RemoveAllPassengers(); }
public void GoToAirplane() { if (DriverIsNotPresent()) { return; } if (_boardingAreaManager.CountPassengers() != 2) { return; } _airplane.GetBoardingAreaManager().AddPassengers(_boardingAreaManager.GetPassengers().ToList()); _boardingAreaManager.RemoveAllPassengers(); }
public List <IPassenger> GetAirplanePassengers() => _airplane.GetBoardingAreaManager().GetPassengers().ToList();
public List <IPassenger> GetDeparturePassengers() => _departureGate.GetBoardingAreaManager().GetPassengers().ToList();