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); }
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); }
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); }