Beispiel #1
0
        public override RoshamboV GetRoshambo()
        {
            Validator validHuman = new Validator();
            string    input      = RoshamboApp.GetInput();
            bool      valid      = (validHuman.ValidateHumanRoshamboInput(input));

            if (valid == true)
            {
                roshamboValue = ConvertInputToRoshambo(input);
            }
            return(roshamboValue);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //create human player object
            HumanPlayer human = new HumanPlayer();


            //create validator object
            Validator validObject = new Validator();        //this may not be needed.. revisit
            bool      valid;

            Console.Write("\nWelcome to ROSHAMBO! \nThis is a game of wits.  Who will represent you in this challenge? \nPlease choose YOUR AVATAR:  Racoon (r), Wolf (w), Crow (c), Monkey (m):  ");
            string input   = RoshamboApp.GetInput();
            string hAvatar = human.GetHAvatar(input);


            Console.WriteLine(hAvatar);
        }
Beispiel #3
0
        public string GetHAvatar()
        {
            string    input        = RoshamboApp.GetInput();
            Validator validHAvatar = new Validator();
            bool      valid        = validHAvatar.ValidateAvatarChoice(input);
            string    hAvatar      = null;

            while (valid == true)
            {
                switch (input)
                {
                case "r":
                    hAvatar = "Racoon";
                    return(hAvatar);

                case "w":
                    hAvatar = "Wolf";
                    return(hAvatar);

                case "m":
                    hAvatar = "Monkey";
                    return(hAvatar);

                case "c":
                    hAvatar = "Crow";
                    return(hAvatar);

                default:
                    valid = false;
                    Console.Write("Please enter 'r' for Racoon, 'w' for Wolf, 'c' for Crow or 'm' for Monkey.   ");
                    input = RoshamboApp.GetInput();
                    valid = validHAvatar.ValidateAvatarChoice(input);
                    break;
                }
            }
            return(hAvatar);
        }