public void AcceptRide(Ride ride)
        {
            InMemoryRideDataBase.SaveRide(ride);
            Taxis.FirstOrDefault(x => x.TaxiDriverId == ride.TaxiDriverId).Location = ride.LocationTo;

            Console.WriteLine("Ride accepted, waiting for driver: " + ride.TaxiDriverName);
        }
        public void AcceptRide(Ride ride)
        {
            InMemoryRideDataBase.SaveRide(ride);

            ride.Vehicle.UpdateLocation(ride.LocationTo);

            Console.WriteLine(string.Format("Ride accepted, waiting for driver: {0}", ride.Vehicle.DriverName));
        }
Exemple #3
0
        public void AcceptRide(Ride ride)
        {
            InMemoryRideDataBase.SaveRide(ride);

            ride.Taxi.Location = ride.LocationTo;

            Console.WriteLine("Ride accepted, waiting for driver: " + ride.Taxi.Driver.Name);
        }
Exemple #4
0
        private void AcceptRide(Ride ride)
        {
            InMemoryRideDataBase.SaveRide(ride);

            ride.TaxiInfo.CurrentLocation = ride.EndLocation;

            Console.WriteLine("Ride accepted, waiting for driver: " + ride.TaxiInfo.DriverName);
            Console.WriteLine("");
        }
Exemple #5
0
        public void AcceptRide(Ride ride)
        {
            InMemoryRideDataBase.SaveRide(ride);
            foreach (Taxi taxi in TaxisList)
            {
                if (taxi.Driver.Id == ride.Driver.Id)
                {
                    taxi.Location = ride.EndLocation;
                }
            }

            Console.WriteLine("Ride accepted, waiting for driver: " + ride.Driver.Name);
        }
        public List <Ride> GetDriverRidesList(int driverId)
        {
            List <Ride> rides = new List <Ride>();

            foreach (Ride ride in InMemoryRideDataBase.GetRides())
            {
                if (ride.Vehicle.DriverId == driverId)
                {
                    rides.Add(ride);
                }
            }

            return(rides);
        }
Exemple #7
0
        public List <Ride> GetRideList(int driver_id)
        {
            var rides = new List <Ride>();
            var ids   = InMemoryRideDataBase.GetRideIds();

            foreach (int id in ids)
            {
                var ride = InMemoryRideDataBase.GetRide(id);
                if (ride.Driver.Id == driver_id)
                {
                    rides.Add(ride);
                }
            }

            return(rides);
        }
Exemple #8
0
        private List <Ride> GetRideList(int driverId)
        {
            List <Ride> rides = new List <Ride>();
            List <int>  ids   = InMemoryRideDataBase.GetRideIds();

            foreach (int id in ids)
            {
                Ride ride = InMemoryRideDataBase.GetRide(id);
                if (ride != null && ride.TaxiInfo.DriverId == driverId)
                {
                    rides.Add(ride);
                }
            }

            return(rides);
        }
 public List <Ride> GetRideList(int driverId)
 {
     return(InMemoryRideDataBase.GetRides().Where(x => x.TaxiDriverId == driverId).ToList());
 }