Example #1
0
        public void TestGetRoshamboHuman()
        {
            HumanPlayer human         = new HumanPlayer();
            RoshamboV   RoshamboValue = human.GetRoshambo("s");

            Assert.AreEqual(RoshamboValue, RoshamboV.scissors);
        }
Example #2
0
        public void TestConvertInputToRoshambo()
        {
            HumanPlayer human     = new HumanPlayer();
            RoshamboV   roshamboH = human.ConvertInputToRoshambo("s");

            Assert.AreEqual(roshamboH, RoshamboV.scissors);
        }
Example #3
0
        public void TestGetRoshamboRock()
        {
            RockPlayer rock         = new RockPlayer();
            RoshamboV  RoshamboRock = rock.GetRoshambo();

            Assert.AreEqual(RoshamboRock, RoshamboV.rock);
        }
Example #4
0
        public void TestGetRoshamboRandom()
        {
            RandomPlayer random         = new RandomPlayer();
            RoshamboV    RoshamboRandom = random.GetRoshambo();

            Assert.IsInstanceOfType(RoshamboRandom, typeof(RoshamboV));
        }
Example #5
0
        //public RoshamboApp(HumanPlayer hAvatar, RockPlayer rAvatar, RandomPlayer rrAvatar)
        //{
        //    HAvatar = hAvatar;
        //    RAvatar = rAvatar;
        //    RrAvatar = rrAvatar;
        //}
        #endregion

        public static string DecideFate(RoshamboV p1, RoshamboV p2)
        {
            string fate = null;

            if (p1 == p2)
            {
                fate = "draw";
            }
            else if (p1 == RoshamboV.paper)
            {
                if (p2 == RoshamboV.rock)
                {
                    fate = "player1";
                }
                else if (p2 == RoshamboV.scissors)
                {
                    fate = "player2";
                }
            }
            else if (p1 == RoshamboV.scissors)
            {
                if (p2 == RoshamboV.rock)
                {
                    fate = "player2";
                }
                else if (p2 == RoshamboV.paper)
                {
                    fate = "player1";
                }
            }
            else if (p1 == RoshamboV.rock)
            {
                if (p2 == RoshamboV.scissors)
                {
                    fate = "player1";
                }
                else if (p2 == RoshamboV.paper)
                {
                    fate = "player2";
                }
            }
            return(fate);
        }
Example #6
0
 public Validator(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Example #7
0
 public RandomPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Example #8
0
 public RockPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Example #9
0
 public HumanPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Example #10
0
 public Player(RoshamboV RoshamboValue)
 {
     roshamboValue = RoshamboValue;
 }