Exemplo n.º 1
0
        public bool evaluateTrunkSize()
        {
            bool volumeOK = checkSingleVolumeOfEveryLuggage() && checkSummaryVolume();
            bool dimXYZOK = checkXYZdimensions();

            string debugMessage = String.Format("Volume OK: {0}, XYZ OK: {1}", volumeOK, dimXYZOK);

            DebugSupporter.printCustomMessage(debugMessage);

            return(volumeOK && dimXYZOK);
        }
Exemplo n.º 2
0
        private bool checkSingleVolumeOfEveryLuggage()
        {
            bool volumeIsEnough = true;

            string debugMessage = String.Format("Dlugosc listy bagazy w TrunkSizeChecker: {0}", luggageList.getLength());

            DebugSupporter.printCustomMessage(debugMessage);

            for (int i = 0; i < luggageList.getLength(); i++)
            {
                volumeIsEnough = volumeIsEnough & checkSingleVolume(luggageList.getLuggage(i));
            }
            return(volumeIsEnough);
        }
Exemplo n.º 3
0
        private bool checkSingleVolume(IContainer luggage)
        {
            bool isLuggageVolumeSmaller = false;

            if (luggage.getVolume() < trunk.getVolume())
            {
                isLuggageVolumeSmaller = true;
            }

            string debugMessage = String.Format("Luggage volume: {0}, Trunk volume: {1}, Evaluation: {2}", luggage.getVolume(), trunk.getVolume(), isLuggageVolumeSmaller);

            DebugSupporter.printCustomMessage(debugMessage);

            return(isLuggageVolumeSmaller);
        }