示例#1
0
        static void Main(string[] args)
        {
            var       consoleIO = new ConsoleResponseThingy();
            YatzyGame yatzy     = new YatzyGame(consoleIO);

            yatzy.Play();
        }
示例#2
0
 public void Test_1s()
 {
     Assert.True(YatzyGame.Ones(1, 2, 3, 4, 5) == 1);
     Assert.Equal(2, YatzyGame.Ones(1, 2, 1, 4, 5));
     Assert.Equal(0, YatzyGame.Ones(6, 2, 2, 4, 5));
     Assert.Equal(4, YatzyGame.Ones(1, 2, 1, 1, 1));
 }
示例#3
0
        public void Chance_scores_sum_of_all_dice()
        {
            int expected = 15;
            int actual   = YatzyGame.Chance(2, 3, 4, 5, 1);

            Assert.Equal(expected, actual);
            Assert.Equal(16, YatzyGame.Chance(3, 3, 4, 5, 1));
        }
示例#4
0
        public void Yatzy_scores_50()
        {
            int expected = 50;
            int actual   = YatzyGame.yatzy(4, 4, 4, 4, 4);

            Assert.Equal(expected, actual);
            Assert.Equal(50, YatzyGame.yatzy(6, 6, 6, 6, 6));
            Assert.Equal(0, YatzyGame.yatzy(6, 6, 6, 6, 3));
        }
示例#5
0
        static void Main(string[] args)
        {
            //YatzyPlayer player1 = new YatzyPlayer("Peter");
            //YatzyPlayer player2 = new YatzyPlayer("Dennis");
            YatzyGame   yatzyGame   = new YatzyGame(2);
            GameManager gameManager = new GameManager();

            yatzyGame.checkDiceEvent      += YatzyGame_checkDice;
            yatzyGame.LockPlayerDiceEvent += YatzyGame_LockPlayerDiceEvent;

            gameManager.GeneratePlayers(yatzyGame.PlayerAmount);

            while (true)
            {
                yatzyGame.Play(gameManager.currentPlayers);
            }
        }
示例#6
0
 public void Four_of_a_knd()
 {
     Assert.Equal(12, YatzyGame.FourOfAKind(3, 3, 3, 3, 5));
     Assert.Equal(20, YatzyGame.FourOfAKind(5, 5, 5, 4, 5));
     Assert.Equal(12, YatzyGame.FourOfAKind(3, 3, 3, 3, 3));
 }
示例#7
0
 public void Three_of_a_kind()
 {
     Assert.Equal(9, YatzyGame.ThreeOfAKind(3, 3, 3, 4, 5));
     Assert.Equal(15, YatzyGame.ThreeOfAKind(5, 3, 5, 4, 5));
     Assert.Equal(9, YatzyGame.ThreeOfAKind(3, 3, 3, 3, 5));
 }
示例#8
0
 public void Two_Pair()
 {
     Assert.Equal(16, YatzyGame.TwoPair(3, 3, 5, 4, 5));
     Assert.Equal(16, YatzyGame.TwoPair(3, 3, 5, 5, 5));
 }
示例#9
0
 public void One_pair()
 {
     Assert.Equal(6, YatzyGame.ScorePair(3, 4, 3, 5, 6));
     Assert.Equal(10, YatzyGame.ScorePair(5, 3, 3, 3, 5));
     Assert.Equal(12, YatzyGame.ScorePair(5, 3, 6, 6, 5));
 }
示例#10
0
 public void Test_threes()
 {
     Assert.Equal(6, YatzyGame.Threes(1, 2, 3, 2, 3));
     Assert.Equal(12, YatzyGame.Threes(2, 3, 3, 3, 3));
 }
示例#11
0
 public void Test_2s()
 {
     Assert.Equal(4, YatzyGame.Twos(1, 2, 3, 2, 6));
     Assert.Equal(10, YatzyGame.Twos(2, 2, 2, 2, 2));
 }
示例#12
0
 public void FullHouse()
 {
     Assert.Equal(18, YatzyGame.FullHouse(6, 2, 2, 2, 6));
     Assert.Equal(0, YatzyGame.FullHouse(2, 3, 4, 5, 6));
 }
示例#13
0
 public void LargeStraight()
 {
     Assert.Equal(20, YatzyGame.LargeStraight(6, 2, 3, 4, 5));
     Assert.Equal(20, YatzyGame.LargeStraight(2, 3, 4, 5, 6));
     Assert.Equal(0, YatzyGame.LargeStraight(1, 2, 2, 4, 5));
 }
示例#14
0
 public void SmallStraight()
 {
     Assert.Equal(15, YatzyGame.SmallStraight(1, 2, 3, 4, 5));
     Assert.Equal(15, YatzyGame.SmallStraight(2, 3, 4, 5, 1));
     Assert.Equal(0, YatzyGame.SmallStraight(1, 2, 2, 4, 5));
 }
示例#15
0
文件: TUI.cs 项目: EmilMagni/Yatzy
        public TUI()

        {
            yatzy = new YatzyGame();
        }
示例#16
0
 public YatzyGameShould()
 {
     _yatzyGame = new YatzyGame();
 }