public static int GetNumberOfFreeSpots() { List <FreeWharfSpace> lista = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour(); var f1 = lista .Select(f => f.LenghtOfFreePlaces) .Sum(); return(f1); }
public virtual bool IsTherePLaceForBoatInHarbour() { List <FreeWharfSpace> list = FreeWharfSpace.ListOfFreeWharfPlacesInHarbour(); var l1 = list .Where(l => l.LenghtOfFreePlaces >= NumberOfWharfPlacesNeededAtHarbour) .ToList(); return(l1.Count() > 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]); }
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); } }
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]); } }