public IEnumerable<Cargo> findCargosOnVoyage(Voyage voyage)
        {
            var onVoyage = new List<Cargo>();
            foreach(Cargo cargo in cargoDb.Values)
            {
                if(voyage.sameAs(cargo.CurrentVoyage))
                {
                    onVoyage.Add(cargo);
                }
            }

            return onVoyage;
        }
        public IEnumerable <Cargo> findCargosOnVoyage(Voyage voyage)
        {
            var onVoyage = new List <Cargo>();

            foreach (Cargo cargo in cargoDb.Values)
            {
                if (voyage.sameAs(cargo.CurrentVoyage))
                {
                    onVoyage.Add(cargo);
                }
            }

            return(onVoyage);
        }
Example #3
0
        /// <summary>
        /// True if this legs matches the handling activity, i.e. the voyage and load location is the same in case of a load activity and so on.
        /// </summary>
        /// <param name="handlingActivity">handling activity</param>
        /// <returns>True if this legs matches the handling activity, i.e. the voyage and load location is the same in case of a load activity and so on.</returns>
        protected internal virtual bool MatchesActivity(HandlingActivity handlingActivity)
        {
            if (Voyage.sameAs(handlingActivity.Voyage))
            {
                if (handlingActivity.Type == HandlingActivityType.LOAD)
                {
                    return(LoadLocation.sameAs(handlingActivity.Location));
                }
                if (handlingActivity.Type == HandlingActivityType.UNLOAD)
                {
                    return(UnloadLocation.sameAs(handlingActivity.Location));
                }
            }

            return(false);
        }