Exemplo n.º 1
0
        public static int GetNumberOfFreeSpots()
        {
            List <FreeWharfSpace> lista = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour();
            var f1 = lista
                     .Select(f => f.LenghtOfFreePlaces)
                     .Sum();

            return(f1);
        }
Exemplo n.º 2
0
        public virtual bool IsTherePLaceForBoatInHarbour()
        {
            List <FreeWharfSpace> list = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour();
            var l1 = list
                     .Where(l => l.LenghtOfFreePlaces >= NumberOfWharfPlacesNeededAtHarbour)
                     .ToList();

            return(l1.Count() > 0);
        }
Exemplo n.º 3
0
        public virtual int CheckForBestPlaceInHarbour()
        {
            List <FreeWharfSpace> list = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour();

            var q1 = list
                     .Where(q => q.LenghtOfFreePlaces >= NumberOfWharfPlacesNeededAtHarbour)
                     .OrderBy(q => (q.LenghtOfFreePlaces > NumberOfWharfPlacesNeededAtHarbour + 4 ? NumberOfWharfPlacesNeededAtHarbour + 5 : q.LenghtOfFreePlaces) + AsCloseSameDaysLeftInHarbour(q))
                     .Select(q => StartOrEndPosition(q))
                     .ToList();

            return(q1[0]);
        }
Exemplo n.º 4
0
        public override bool IsTherePLaceForBoatInHarbour()
        {
            int halfPlaceSpot = FreeWharfSpace.WhereIsHalfPlace();

            if (halfPlaceSpot > 0)
            {
                return(true);
            }
            else
            {
                List <FreeWharfSpace> list = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour();
                var l1 = list
                         .Where(l => l.LenghtOfFreePlaces >= NumberOfWharfPlacesNeededAtHarbour)
                         .ToList();

                return(l1.Count() > 0);
            }
        }
Exemplo n.º 5
0
        public override int CheckForBestPlaceInHarbour()
        {
            int halfPlaceSpot = FreeWharfSpace.WhereIsHalfPlace();

            if (halfPlaceSpot > 0)
            {
                return(halfPlaceSpot);
            }
            else
            {
                List <FreeWharfSpace> list = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour();

                var q1 = list
                         .Where(q => q.LenghtOfFreePlaces >= NumberOfWharfPlacesNeededAtHarbour)
                         .OrderBy(q => (q.LenghtOfFreePlaces > NumberOfWharfPlacesNeededAtHarbour + 4 ? NumberOfWharfPlacesNeededAtHarbour + 5 : q.LenghtOfFreePlaces) + AsCloseSameDaysLeftInHarbour(q))
                         .Select(q => StartOrEndPosition(q))
                         .ToList();
                return(q1[0]);
            }
        }