Exemplo n.º 1
0
        public static WareHouse MoveBox(WareHouse facility)
        {
            Console.Write("Input box ID: ");
            bool correctId = int.TryParse(Console.ReadLine(), out int iD);

            Console.Write("Input which level the box should be moved to: ");
            bool correctLevel = int.TryParse(Console.ReadLine(), out int level);

            Console.Write("Input which storage unit the box should be moved to: ");
            bool correctLocation = int.TryParse(Console.ReadLine(), out int location);
            bool succes          = false;

            if (correctId && correctLevel && correctLocation)
            {
                succes = facility.Move(iD, level, location);
            }
            else
            {
                Console.WriteLine("Incorrect input.");
                return(facility);
            }

            if (succes)
            {
                Console.WriteLine("Box moved");
            }
            else
            {
                Console.WriteLine("Box didnt fit in storage unit or wasnt found");
            }
            Console.ReadKey();
            return(facility);
        }