Exemplo n.º 1
0
        public void TestGetRoshamboHuman()
        {
            HumanPlayer human         = new HumanPlayer();
            RoshamboV   RoshamboValue = human.GetRoshambo("s");

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

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

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

            Assert.IsInstanceOfType(RoshamboRandom, typeof(RoshamboV));
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 public Validator(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Exemplo n.º 7
0
 public RandomPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Exemplo n.º 8
0
 public RockPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Exemplo n.º 9
0
 public HumanPlayer(RoshamboV roshamboValue) : base(roshamboValue)
 {
 }
Exemplo n.º 10
0
 public Player(RoshamboV RoshamboValue)
 {
     roshamboValue = RoshamboValue;
 }