Пример #1
0
        public void TestGetRoshamboHuman()
        {
            HumanPlayer human         = new HumanPlayer();
            RoshamboV   RoshamboValue = human.GetRoshambo("s");

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

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

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

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