public void Run()
        {
            string input = Console.ReadLine();

            while (input != "END")
            {
                string[] commandArgs = input.Split();
                string   command     = commandArgs[0];
                string[] parameters  = commandArgs.Skip(1).ToArray();

                string output = "";
                try
                {
                    output = ParseCommand(command, parameters);
                    Console.WriteLine(output);
                }
                catch (Exception exception)
                {
                    Console.WriteLine($"Error: {exception.Message}");
                }

                input = Console.ReadLine();
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #2
0
        public void Run()
        {
            while (true)
            {
                string[] input = Console.ReadLine().Split();
                if (input[0] == "END")
                {
                    break;
                }

                StringBuilder result = new StringBuilder();

                string command = input[0];

                try
                {
                    result.AppendLine(ReadCommands(command, input));
                }
                catch (Exception e)
                {
                    result.AppendLine("Error: " + e.Message);
                }

                if (result != null)
                {
                    Console.WriteLine(result.ToString().TrimEnd());
                }
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
        public void Run()
        {
            while (isRunning)
            {
                var input = Console.ReadLine();
                if (input == "END")
                {
                    isRunning = false;
                    break;
                }
                try
                {
                    var inputArgs   = input.Split(" ", StringSplitOptions.RemoveEmptyEntries).ToArray();
                    var command     = inputArgs[0];
                    var commandArgs = inputArgs.Skip(1).ToArray();
                    Execute(command, commandArgs);
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
        public void Run()
        {
            string        command = "";
            string        output  = "";
            StringBuilder result  = new StringBuilder();

            while ((command = Console.ReadLine()) != "END")
            {
                try
                {
                    string[] data = command.Split(" ");
                    output = CommandParser(data);
                    result.AppendLine(output);
                }
                catch (InvalidOperationException ex)
                {
                    result.AppendLine("Error: " + ex.Message);
                }
            }

            Console.WriteLine(result.ToString().Trim());
            string summary = storageMaster.GetSummary();

            Console.WriteLine(summary);
        }
Exemple #5
0
        private string RealiseCommand(string[] arr)
        {
            switch (arr[0])
            {
            case "AddProduct":
                return(cm.AddProduct(arr[1], double.Parse(arr[2])));

            case "RegisterStorage":
                return(cm.RegisterStorage(arr[1], arr[2]));

            case "SelectVehicle":
                return(cm.SelectVehicle(arr[1], int.Parse(arr[2])));

            case "LoadVehicle":
                return(cm.LoadVehicle(arr.Skip(1)));

            case "SendVehicleTo":
                return(cm.SendVehicleTo(arr[1], int.Parse(arr[2]), arr[3]));

            case "UnloadVehicle":
                return(cm.UnloadVehicle(arr[1], int.Parse(arr[2])));

            case "GetStorageStatus":
                return(cm.GetStorageStatus(arr[1]));

            case "END":
                return(cm.GetSummary());

            default:
                throw new ArgumentException("Didn Realise Command");
            }
        }
Exemple #6
0
        public void Run()
        {
            StorageMaster storageMaster = new StorageMaster();

            while (true)
            {
                var    input   = Console.ReadLine().Split();
                string command = input[0];

                if (command.Equals("END"))
                {
                    break;
                }

                string result = null;

                try
                {
                    switch (command)
                    {
                    case "AddProduct":
                        result = storageMaster.AddProduct(input[1], double.Parse(input[2]));
                        break;

                    case "RegisterStorage":
                        result = storageMaster.RegisterStorage(input[1], input[2]);
                        break;

                    case "SelectVehicle":
                        result = storageMaster.SelectVehicle(input[1], int.Parse(input[2]));
                        break;

                    case "LoadVehicle":
                        result = storageMaster.LoadVehicle(input.Skip(1).ToList());
                        break;

                    case "SendVehicleTo":
                        result = storageMaster.SendVehicleTo(input[1], int.Parse(input[2]), input[3]);
                        break;

                    case "UnloadVehicle":
                        result = storageMaster.UnloadVehicle(input[1], int.Parse(input[2]));
                        break;

                    case "GetStorageStatus":
                        result = storageMaster.GetStorageStatus(input[1]);
                        break;
                    }
                }
                catch (InvalidOperationException e)
                {
                    result = "Error: " + e.Message;
                }
                Console.WriteLine(result);
            }
            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #7
0
 public void Run()
 {
     string[] inputArgs;
     while ((inputArgs = Console.ReadLine().Split())[0] != "END")
     {
         string command = inputArgs[0].ToLower();
         try
         {
             if (command == "addproduct")
             {
                 string type  = inputArgs[1];
                 double price = double.Parse(inputArgs[2]);
                 Console.WriteLine(sm.AddProduct(type, price));
             }
             else if (command == "registerstorage")
             {
                 string type = inputArgs[1];
                 string name = inputArgs[2];
                 Console.WriteLine(sm.RegisterStorage(type, name));
             }
             else if (command == "selectvehicle")
             {
                 string storageName = inputArgs[1];
                 int    garageSlot  = int.Parse(inputArgs[2]);
                 Console.WriteLine(sm.SelectVehicle(storageName, garageSlot));
             }
             else if (command == "loadvehicle")
             {
                 string[] products = inputArgs.Skip(1).ToArray();
                 Console.WriteLine(sm.LoadVehicle(products));
             }
             else if (command == "sendvehicleto")
             {
                 string sourceName       = inputArgs[1];
                 int    sourceGarageSlot = int.Parse(inputArgs[2]);
                 string destinationName  = inputArgs[3];
                 Console.WriteLine(sm.SendVehicleTo(sourceName, sourceGarageSlot, destinationName));
             }
             else if (command == "unloadvehicle")
             {
                 string storageName = inputArgs[1];
                 int    garageSlot  = int.Parse(inputArgs[2]);
                 Console.WriteLine(sm.UnloadVehicle(storageName, garageSlot));
             }
             else if (command == "getstoragestatus")
             {
                 string storageName = inputArgs[1];
                 Console.WriteLine(sm.GetStorageStatus(storageName));
             }
         }
         catch (InvalidOperationException ioe)
         {
             Console.WriteLine("Error: " + ioe.Message);
         }
     }
     Console.Write(sm.GetSummary());
 }
Exemple #8
0
        public void Run()
        {
            string        command = Console.ReadLine();
            StorageMaster master  = new StorageMaster();

            while (command != "END")
            {
                string[] arr = command.Split();

                try
                {
                    switch (arr[0])
                    {
                    case "AddProduct":
                        string type  = arr[1];
                        double price = double.Parse(arr[2]);
                        Console.WriteLine(master.AddProduct(type, price));
                        break;

                    case "RegisterStorage":
                        type = arr[1];
                        string name = arr[2];
                        Console.WriteLine(master.RegisterStorage(type, name));
                        break;

                    case "SelectVehicle":
                        Console.WriteLine(master.SelectVehicle(storageName: arr[1], garageSlot: int.Parse(arr[2])));
                        break;

                    case "LoadVehicle":
                        IEnumerable <string> productNames = arr.Skip(1).ToArray();
                        Console.WriteLine(master.LoadVehicle(productNames));
                        break;

                    case "SendVehicleTo":
                        Console.WriteLine(master.SendVehicleTo(sourceName: arr[1], sourceGarageSlot: int.Parse(arr[2]), destinationName: arr[3]));
                        break;

                    case "UnloadVehicle":
                        Console.WriteLine(master.UnloadVehicle(storageName: arr[1], garageSlot: int.Parse(arr[2])));
                        break;

                    case "GetStorageStatus":
                        Console.WriteLine(master.GetStorageStatus(storageName: arr[1]));
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }
                command = Console.ReadLine();
            }
            Console.WriteLine(master.GetSummary());
        }
        public void Run()
        {
            string input;

            while ((input = Console.ReadLine()) != "END")
            {
                var command = input.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToArray();
                var args    = command.Skip(1).ToArray();
                try
                {
                    switch (command[0])
                    {
                    case "AddProduct":
                        Console.WriteLine(storageMaster.AddProduct(args[0], double.Parse(args[1])));
                        break;

                    case "RegisterStorage":
                        Console.WriteLine(storageMaster.RegisterStorage(args[0], args[1]));
                        break;

                    case "SelectVehicle":
                        Console.WriteLine(storageMaster.SelectVehicle(args[0], int.Parse(args[1])));
                        break;

                    case "LoadVehicle":
                        Console.WriteLine(storageMaster.LoadVehicle(args));
                        break;

                    case "SendVehicleTo":
                        Console.WriteLine(storageMaster.SendVehicleTo(args[0], int.Parse(args[1]), args[2]));
                        break;

                    case "UnloadVehicle":
                        Console.WriteLine(storageMaster.UnloadVehicle(args[0], int.Parse(args[1])));
                        break;

                    case "GetStorageStatus":
                        Console.WriteLine(storageMaster.GetStorageStatus(args[0]));
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #10
0
        public void Run()
        {
            var storageMaster = new StorageMaster();

            string commandLine;

            while ((commandLine = Console.ReadLine()) != "END")
            {
                try
                {
                    Execute(commandLine, storageMaster);
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #11
0
        public void Run()
        {
            string inputLine = Console.ReadLine();

            while (inputLine != "END")
            {
                try
                {
                    MoveCommand(inputLine, sm);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error: {ex.GetBaseException().Message}");
                }


                inputLine = Console.ReadLine();
            }

            Console.WriteLine(sm.GetSummary());
        }
Exemple #12
0
        public void Run()
        {
            sb.AppendLine("=====================");
            string input;

            while ((input = Read()) != "END")
            {
                try
                {
                    var args = input.Split();

                    Print(RunCommand(args));
                }
                catch (InvalidOperationException ioe)
                {
                    Print("Error: " + ioe.Message);
                }
            }

            Print(storageMaster.GetSummary());

            //Console.WriteLine(sb.ToString()); //Remove the comment from the front to get the Output collected
        }
Exemple #13
0
        public void Run()
        {
            while (true)
            {
                try
                {
                    string line = Console.ReadLine();
                    if (line == "END")
                    {
                        break;
                    }
                    string[] args   = line.Split();
                    string   result = ReadCommand(args);

                    Console.WriteLine(result);
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
            }

            Console.WriteLine(storageMaster.GetSummary());
        }
        static void Main(string[] args)
        {
            string[]      command = Console.ReadLine().Split(' ').ToArray();
            StorageMaster sm      = new StorageMaster();

            while (command[0] != "END")
            {
                try
                {
                    if (command[0] == "AddProduct")
                    {
                        string type   = command[1];
                        double price  = double.Parse(command[2]);
                        var    result = sm.AddProduct(type, price);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "RegisterStorage")
                    {
                        string type   = command[1];
                        string name   = command[2];
                        var    result = sm.RegisterStorage(type, name);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "SelectVehicle")
                    {
                        string storageName = command[1];
                        int    garageSlot  = int.Parse(command[2]);
                        var    result      = sm.SelectVehicle(storageName, garageSlot);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "LoadVehicle")
                    {
                        int           lenght   = command.Length;
                        List <string> products = new List <string>();

                        for (int i = 1; i < command.Length; i++)
                        {
                            products.Add(command[i]);
                        }
                        IEnumerable <string> p = products.AsEnumerable();
                        var result             = sm.LoadVehicle(p);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "SendVehicleTo")
                    {
                        string sourceName      = command[1];
                        int    sourceSlot      = int.Parse(command[2]);
                        string destinationName = command[3];

                        var result = sm.SendVehicleTo(sourceName, sourceSlot, destinationName);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "UnloadVehicle")
                    {
                        string storageName = command[1];
                        int    sourceSlot  = int.Parse(command[2]);

                        var result = sm.UnloadVehicle(storageName, sourceSlot);
                        Console.WriteLine(result);
                    }
                    else if (command[0] == "GetStorageStatus")
                    {
                        string storageName = command[1];
                        var    result      = sm.GetStorageStatus(storageName);
                        Console.WriteLine(result);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
                command = Console.ReadLine().Split(' ').ToArray();
            }

            string summary = sm.GetSummary();

            Console.WriteLine(summary);
        }
Exemple #15
0
        public void Run()
        {
            string input = Console.ReadLine();

            while (input != "END")
            {
                string[] tokens  = input.Split();
                string   command = tokens[0];
                try
                {
                    switch (command)
                    {
                    case "AddProduct":
                    {
                        string type  = tokens[1];
                        double price = double.Parse(tokens[2]);
                        Print(this.storageMaster.AddProduct(type, price));
                    }; break;

                    case "RegisterStorage":
                    {
                        string type = tokens[1];
                        string name = tokens[2];
                        Print(this.storageMaster.RegisterStorage(type, name));
                    }; break;

                    case "SelectVehicle":
                    {
                        string storageName = tokens[1];
                        int    garageSlot  = int.Parse(tokens[2]);
                        Print(this.storageMaster.SelectVehicle(storageName, garageSlot));
                    }; break;

                    case "SendVehicleTo":
                    {
                        string sourceName      = tokens[1];
                        int    garageSlot      = int.Parse(tokens[2]);
                        string destinationName = tokens[3];
                        Print(this.storageMaster.SendVehicleTo(sourceName, garageSlot, destinationName));
                    }; break;

                    case "UnloadVehicle":
                    {
                        string storageName = tokens[1];
                        int    garageSlot  = int.Parse(tokens[2]);
                        Print(this.storageMaster.UnloadVehicle(storageName, garageSlot));
                    }; break;

                    case "GetStorageStatus":
                    {
                        string storageName = tokens[1];
                        Print(this.storageMaster.GetStorageStatus(storageName));
                    }; break;

                    case "LoadVehicle":
                    {
                        var products = tokens.Skip(1).ToList();
                        Print(this.storageMaster.LoadVehicle(products));
                    }
                    break;
                    }
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }

                input = Console.ReadLine();
            }
            Print(storageMaster.GetSummary());
        }
        public static void Run()
        {
            StorageMaster sm = new StorageMaster();
            string        input;

            while ((input = Console.ReadLine()) != "END")
            {
                try
                {
                    string[] commandArgs = input
                                           .Split();
                    string command = commandArgs[0];
                    string result  = string.Empty;

                    switch (command)
                    {
                    case "AddProduct":
                    {
                        string type  = commandArgs[1];
                        double price = double.Parse(commandArgs[2]);
                        result = sm.AddProduct(type, price);
                        break;
                    }

                    case "RegisterStorage":
                    {
                        string type = commandArgs[1];
                        string name = commandArgs[2];
                        result = sm.RegisterStorage(type, name);
                        break;
                    }

                    case "SelectVehicle":
                    {
                        string name       = commandArgs[1];
                        int    garageSlot = int.Parse(commandArgs[2]);
                        result = sm.SelectVehicle(name, garageSlot);
                        break;
                    }

                    case "LoadVehicle":
                    {
                        IEnumerable <string> productNames = commandArgs.Skip(1);
                        result = sm.LoadVehicle(productNames);
                        break;
                    }

                    case "SendVehicleTo":
                    {
                        string sourceName       = commandArgs[1];
                        int    sourceGarageSlot = int.Parse(commandArgs[2]);
                        string destinationName  = commandArgs[3];
                        result = sm.SendVehicleTo(sourceName, sourceGarageSlot, destinationName);
                        break;
                    }

                    case "UnloadVehicle":
                    {
                        string storageName = commandArgs[1];
                        int    garageSlot  = int.Parse(commandArgs[2]);
                        result = sm.UnloadVehicle(storageName, garageSlot);
                        break;
                    }

                    case "GetStorageStatus":
                    {
                        string storageName = commandArgs[1];
                        result = sm.GetStorageStatus(storageName);
                        break;
                    }

                    default:
                        break;
                    }

                    Console.WriteLine(result);
                }
                catch (Exception e)
                {
                    if (e.InnerException != null)
                    {
                        Console.WriteLine(e.InnerException.Message);
                    }
                    else
                    {
                        Console.WriteLine(e.Message);
                    }
                }
            }

            Console.WriteLine(sm.GetSummary());
        }
Exemple #17
0
        public void Run()
        {
            string input = Console.ReadLine();

            while (input != "END")
            {
                string[] tokens  = input.Split().ToArray();
                string   command = tokens[0];
                string   result  = string.Empty;

                try
                {
                    switch (command)
                    {
                    case "AddProduct":
                        //{type} {price}
                        string productTypeToAdd = tokens[1];
                        double priceToAdd       = double.Parse(tokens[2]);
                        result = storageMaster.AddProduct(productTypeToAdd, priceToAdd);
                        Console.WriteLine(result);
                        break;

                    case "RegisterStorage":
                        // {type} {name}
                        string storageTypeToAdd = tokens[1];
                        string nameToAdd        = tokens[2];
                        result = storageMaster.RegisterStorage(storageTypeToAdd, nameToAdd);
                        Console.WriteLine(result);
                        break;

                    case "SelectVehicle":
                        // {storageName} {garageSlot}
                        string storageName        = tokens[1];
                        int    garageSlotToSelect = int.Parse(tokens[2]);
                        result = storageMaster.SelectVehicle(storageName, garageSlotToSelect);
                        Console.WriteLine(result);
                        break;

                    case "LoadVehicle":
                        // {productName1} {productName2} {productNameN}
                        string[] productsToAdd = tokens.Skip(1).ToArray();
                        result = storageMaster.LoadVehicle(productsToAdd);
                        Console.WriteLine(result);
                        break;

                    case "SendVehicleTo":
                        // {sourceName} {sourceGarageSlot} {destinationName}
                        string sourceName       = tokens[1];
                        int    sourceGarageSlot = int.Parse(tokens[2]);
                        string destinationName  = tokens[2];
                        result = storageMaster.SendVehicleTo(sourceName, sourceGarageSlot, destinationName);
                        Console.WriteLine(result);
                        break;

                    case "UnloadVehicle":
                        // {storageName} {garageSlot}
                        string storageNameToUnload = tokens[1];
                        int    garageSlot          = int.Parse(tokens[2]);
                        result = storageMaster.UnloadVehicle(storageNameToUnload, garageSlot);
                        Console.WriteLine(result);
                        break;

                    case "GetStorageStatus":
                        // {storageName}
                        string storageNameStatus = tokens[1];
                        result = storageMaster.GetStorageStatus(storageNameStatus);
                        Console.WriteLine(result);
                        break;
                    }
                }
                catch (InvalidOperationException ioe)
                {
                    Console.WriteLine($"Error:{ioe.Message}");
                }
            }

            string summary = storageMaster.GetSummary();

            Console.WriteLine(summary);
        }
Exemple #18
0
        public void Run()
        {
            string[] command = Console.ReadLine()
                               .Split(" ", StringSplitOptions.RemoveEmptyEntries)
                               .ToArray();

            StorageMaster storageMaster = new StorageMaster();

            while (command[0]?.ToLower() != "end")
            {
                try
                {
                    string type             = string.Empty;
                    double price            = 0;
                    string name             = string.Empty;
                    string storageName      = string.Empty;
                    int    garageSlot       = 0;
                    string sourceName       = string.Empty;
                    int    sourceGarageSlot = 0;
                    string destinationName  = string.Empty;

                    switch (command[0].ToLower())
                    {
                    case "addproduct":
                        type  = command[1];
                        price = double.Parse(command[2]);
                        string addedProduct = storageMaster.AddProduct(type, price);
                        Console.WriteLine(addedProduct);
                        break;

                    case "registerstorage":
                        type = command[1];
                        name = command[2];
                        string registeredStorage = storageMaster.RegisterStorage(type, name);
                        Console.WriteLine(registeredStorage);
                        break;

                    case "selectvehicle":
                        storageName = command[1];
                        garageSlot  = int.Parse(command[2]);
                        string selectedVehicle = storageMaster.SelectVehicle(storageName, garageSlot);
                        Console.WriteLine(selectedVehicle);
                        break;

                    case "loadvehicle":
                        List <string> productNames = new List <string>();
                        for (int i = 1; i < command.Length; i++)
                        {
                            productNames.Add(command[i]);
                        }
                        string loadedVehicle = storageMaster.LoadVehicle(productNames);
                        Console.WriteLine(loadedVehicle);
                        break;

                    case "sendvehicleto":
                        sourceName       = command[1];
                        sourceGarageSlot = int.Parse(command[2]);
                        destinationName  = command[3];
                        string sendVehicle = storageMaster.SendVehicleTo(sourceName, sourceGarageSlot, destinationName);
                        Console.WriteLine(sendVehicle);
                        break;

                    case "unloadvehicle":
                        storageName = command[1];
                        garageSlot  = int.Parse(command[2]);
                        string unloadedVehicle = storageMaster.UnloadVehicle(storageName, garageSlot);
                        Console.WriteLine(unloadedVehicle);
                        break;

                    case "getstoragestatus":
                        storageName = command[1];
                        string storageStatus = storageMaster.GetStorageStatus(storageName);
                        Console.WriteLine(storageStatus);
                        break;

                    default:
                        break;
                    }
                }
                catch (InvalidOperationException e)
                {
                    Console.WriteLine($"Error: {e.Message}");
                }
                command = Console.ReadLine()
                          .Split(" ", StringSplitOptions.RemoveEmptyEntries)
                          .ToArray();
            }
            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #19
0
        public void Run()
        {
            string[] input = Console.ReadLine().Split();

            while (input[0] != "END")
            {
                try
                {
                    string command = input[0];
                    switch (command)
                    {
                    case "AddProduct":
                        string type  = input[1];
                        double price = double.Parse(input[2]);
                        Console.WriteLine(storageMaster.AddProduct(type, price));
                        break;

                    case "RegisterStorage":
                        type = input[1];
                        string name = input[2];
                        Console.WriteLine(storageMaster.RegisterStorage(type, name));

                        break;

                    case "SelectVehicle":
                        string storageName = input[1];
                        int    garageSlot  = int.Parse(input[2]);
                        Console.WriteLine(storageMaster.SelectVehicle(storageName, garageSlot));

                        break;

                    case "LoadVehicle":

                        Console.WriteLine(storageMaster.LoadVehicle(input.Skip(1)));
                        break;

                    case "SendVehicleTo":
                        string sourceName       = input[1];
                        int    sourceGarageSlot = int.Parse(input[2]);
                        string destinationName  = input[3];
                        Console.WriteLine(storageMaster.SendVehicleTo(sourceName, sourceGarageSlot, destinationName));

                        break;

                    case "UnloadVehicle":
                        storageName = input[1];
                        garageSlot  = int.Parse(input[2]);
                        Console.WriteLine(storageMaster.UnloadVehicle(storageName, garageSlot));

                        break;

                    case "GetStorageStatus":
                        storageName = input[1];
                        Console.WriteLine(storageMaster.GetStorageStatus(storageName));
                        break;
                    }
                }
                catch (InvalidOperationException ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
                input = Console.ReadLine().Split();
            }
            Console.WriteLine(storageMaster.GetSummary());
        }
Exemple #20
0
        public void Run()
        {
            string input = Console.ReadLine();

            while (input != "END")
            {
                try
                {
                    string[] comands = input.Split();

                    string call = comands[0];

                    string output = "";
                    if (call == "AddProduct")
                    {
                        string type  = comands[1];
                        double price = double.Parse(comands[2]);

                        output = storageMaster.AddProduct(type, price);
                    }
                    else if (call == "RegisterStorage")
                    {
                        string type = comands[1];
                        string name = comands[2];

                        output = storageMaster.RegisterStorage(type, name);
                    }
                    else if (call == "SelectVehicle")
                    {
                        string storigName = comands[1];
                        int    garageSlot = int.Parse(comands[2]);

                        output = storageMaster.SelectVehicle(storigName, garageSlot);
                    }
                    else if (call == "LoadVehicle")
                    {
                        string[] hold = comands.Skip(1).ToArray();

                        output = storageMaster.LoadVehicle(hold);
                    }
                    else if (call == "SendVehicleTo")
                    {
                        string sourceName       = comands[1];
                        int    sourceGarageSlot = int.Parse(comands[2]);
                        string destinationName  = comands[3];

                        output = storageMaster.SendVehicleTo(sourceName, sourceGarageSlot, destinationName);
                    }
                    else if (call == "UnloadVehicle")
                    {
                        string storageName = comands[1];
                        int    garageSlot  = int.Parse(comands[2]);

                        output = storageMaster.UnloadVehicle(storageName, garageSlot);
                    }
                    else if (call == "GetStorageStatus")
                    {
                        string storageName = comands[1];

                        output = storageMaster.GetStorageStatus(storageName);
                    }

                    Console.WriteLine(output);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }

                input = Console.ReadLine();
            }

            Console.WriteLine(storageMaster.GetSummary());
        }