static void Main()
        {
            var line = Console.ReadLine();

            var pawIncManager = new PawIncManager();

            var adoptionCenterName  = string.Empty;
            var cleansingCenterName = string.Empty;

            while (true)
            {
                if (line.Equals("Paw Paw Pawah"))
                {
                    Console.WriteLine(pawIncManager.Report());
                    break;
                }

                var arguments = line.Split(new string[] { " | " }, StringSplitOptions.RemoveEmptyEntries).ToList();
                var command   = arguments[0];
                arguments.RemoveAt(0);

                switch (command)
                {
                case "RegisterAdoptionCenter":
                    adoptionCenterName = arguments[0];
                    pawIncManager.RegisterAdoptionCenter(adoptionCenterName);
                    break;

                case "RegisterCleansingCenter":
                    cleansingCenterName = arguments[0];
                    pawIncManager.RegisterCleansingCenter(cleansingCenterName);
                    break;

                case "RegisterDog":
                    pawIncManager.RegisterDog(arguments);
                    break;

                case "RegisterCat":
                    pawIncManager.RegisterCat(arguments);
                    break;

                case "SendForCleansing":
                    pawIncManager.SendForCleansing(arguments);
                    break;

                case "Cleanse":
                    cleansingCenterName = arguments[0];
                    pawIncManager.Cleanse(cleansingCenterName);
                    break;

                case "Adopt":
                    adoptionCenterName = arguments[0];
                    pawIncManager.Adopt(adoptionCenterName);
                    break;
                }


                line = Console.ReadLine();
            }
        }
Ejemplo n.º 2
0
    public void Start()
    {
        string input;

        while ((input = Console.ReadLine()) != "Paw Paw Pawah")
        {
            string[] splitInput = input.Split(new string[] { " | " }, StringSplitOptions.RemoveEmptyEntries);

            switch (splitInput[0])
            {
            case "RegisterAdoptionCenter":
                pawIncManager.RegisterAdoptionCenter(splitInput[1]);
                break;

            case "RegisterCleansingCenter":
                pawIncManager.RegisterCleansingCenter(splitInput[1]);
                break;

            case "RegisterCastrationCenter":
                pawIncManager.RegisterCastrationCenter(splitInput[1]);
                break;

            case "RegisterCat":
                pawIncManager.RegisterCat(splitInput[1], int.Parse(splitInput[2]), int.Parse(splitInput[3]), splitInput[4]);
                break;

            case "RegisterDog":
                pawIncManager.RegisterDog(splitInput[1], int.Parse(splitInput[2]), int.Parse(splitInput[3]), splitInput[4]);
                break;

            case "SendForCleansing":
                pawIncManager.SendForCleansing(splitInput[1], splitInput[2]);
                break;

            case "Cleanse":
                pawIncManager.Cleanse(splitInput[1]);
                break;

            case "SendForCastration":
                pawIncManager.SendForCastration(splitInput[1], splitInput[2]);
                break;

            case "Castrate":
                pawIncManager.Castrate(splitInput[1]);
                break;

            case "CastrationStatistics":
                pawIncManager.CastrationStatistics();
                break;

            case "Adopt":
                pawIncManager.Adopt(splitInput[1]);
                break;
            }
        }
        Console.WriteLine(pawIncManager);
    }