Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Organizer bagaznika. Wesja 1.0");
            Console.WriteLine("******************************\n");

            Trunk bagaznik = new Trunk(50, 50, 50);

            Console.WriteLine("Bagaznik: {0}\n", bagaznik);

            listaBagazy.addLuggage(new Suitcase(24, 26, 26));
            listaBagazy.addLuggage(new Suitcase(24, 26, 26));

            DebugSupporter.printPropertyValue(nameof(listaBagazy), listaBagazy);
            DebugSupporter.printPropertyValue("listaBagazy.getLength()", listaBagazy.getLength());

            /*
             *          listaBagazy.addLuggage(new Suitcase(10, 50, 70));
             *          listaBagazy.addLuggage(new Suitcase(20, 30, 40));
             *          listaBagazy.addLuggage(new Suitcase(99, 12, 17));
             *          listaBagazy.addLuggage(new Suitcase(51, 14, 13));
             *          listaBagazy.addLuggage(new Suitcase(71, 18, 98));
             *          listaBagazy.addLuggage(new Suitcase(99, 12, 17));
             *          listaBagazy.addLuggage(new Suitcase(51, 99, 13));
             *          listaBagazy.addLuggage(new Suitcase(71, 18, 99));
             */

            LuggageCalc optymalizatorBagaznika = new LuggageCalc(listaBagazy, bagaznik);

            Console.WriteLine("Lista nieposortowana:");
            Console.WriteLine("******************************\n");
            Console.WriteLine(listaBagazy);
        }
        public LuggageCalc(LuggageList luggageList, IContainer trunk)
        {
            if (luggageList == null || trunk == null)
            {
                throw new ArgumentNullException("Luggage list or trunk not existing");
            }

            this.luggageList = luggageList;
            this.trunk       = (Trunk)trunk;

            TrunkSizeChecker checkTrunksSize = new TrunkSizeChecker(luggageList, trunk);

            isTrunkBigEnough = checkTrunksSize.evaluateTrunkSize();

            DebugSupporter.printPropertyValue(nameof(isTrunkBigEnough), isTrunkBigEnough);
        }