コード例 #1
0
 public static int GetFerryTurnaroundTime(PortModel destination)
 {
     if (destination.Id == 3)
         return 25;
     if (destination.Id == 2)
         return 20;
     return 15;
 }
        private static void BoatReady(TimeTableEntry timetable, PortModel destination, FerryJourney ferryJourney)
        {
            if (ferryJourney.Ferry == null)
                FerryManager.AddFerry(timetable, ferryJourney);

            var ferry = ferryJourney.Ferry;

            var time = FerryModule.TimeReady(timetable, destination);
            destination.AddBoat(time, ferry);
        }
コード例 #3
0
        public static TimeSpan TimeReady(TimeTableEntry timetable, PortModel destination)
        {
            if (timetable == null)
                return new TimeSpan(0,0,0);
            if (destination == null)
                throw new ArgumentNullException("destination");

            var arrivalTime = timetable.Time.Add(timetable.JourneyTime);
            int turnaroundTime = FerryManager.GetFerryTurnaroundTime(destination);
            var timeReady = arrivalTime.Add(TimeSpan.FromMinutes(turnaroundTime));
            return timeReady;
        }