Beispiel #1
0
        public override VoyageState DepartFrom(ILocation location)
        {
            if (LastKnownLocation.Equals(location.UnLocode))
            {
                return(new MovingVoyage(Number, Schedule, _movementIndex));
            }
            string message = string.Format("The voyage stopped over at {0}.", LastKnownLocation);

            throw new ArgumentException(message, "location");
        }
Beispiel #2
0
        public override VoyageState StopOverAt(ILocation location)
        {
            if (LastKnownLocation.Equals(location.UnLocode))
            {
                return(this);
            }
            string message = string.Format("The voyage stopped over at {0}.", LastKnownLocation);

            throw new ArgumentException(message, "location");
        }
Beispiel #3
0
        public override VoyageState DepartFrom(ILocation location)
        {
            if (LastKnownLocation.Equals(location.UnLocode))
            {
                return(this);
            }
            string message = string.Format("The voyage departed from {0}.", LastKnownLocation);

            throw new ArgumentException(message, "location");
        }
Beispiel #4
0
 public bool Equals(IDelivery other)
 {
     if (null == other)
     {
         return(false);
     }
     if (object.ReferenceEquals(this, other))
     {
         return(true);
     }
     if (null != CurrentVoyage && !CurrentVoyage.Equals(other.CurrentVoyage))
     {
         return(false);
     }
     if (null == CurrentVoyage && null != other.CurrentVoyage)
     {
         return(false);
     }
     if (null != LastKnownLocation && !LastKnownLocation.Equals(other.LastKnownLocation))
     {
         return(false);
     }
     if (null == LastKnownLocation && null != other.LastKnownLocation)
     {
         return(false);
     }
     if (TransportStatus != other.TransportStatus)
     {
         return(false);
     }
     if (_routingStatus != other.RoutingStatus)
     {
         return(false);
     }
     if (IsUnloadedAtDestination != other.IsUnloadedAtDestination)
     {
         return(false);
     }
     return(true);
 }