コード例 #1
0
        private ParkingLot ChooseParkingLotWithMoreEmptyPositions()
        {
            var maxCapacity = ParkingLots.Max(p => p.Capacity);

            return(ParkingLots.Find(p => p.Capacity == maxCapacity && p.IsFull == false));
        }
コード例 #2
0
        private ParkingLot ChooseParkingLotWithLargerAvailablePositionRate()
        {
            var maxAvailablePositionRate = ParkingLots.Max(p => GetAvailablePositionRate(p));

            return(ParkingLots.Find(p => GetAvailablePositionRate(p) == maxAvailablePositionRate && p.IsFull == false));
        }