コード例 #1
0
        public void GetsNextPlayerNotSiquant4()
        {
            var state = new GameTableState();

            state.Players = new Dictionary <int, GamePlayer>();
            state.Players.Add(2, new GamePlayer
            {
                Position = 2, UserId = "me2"
            });
            state.Players.Add(3, new GamePlayer
            {
                Position = 3, UserId = "me3"
            });
            state.Players.Add(5, new GamePlayer
            {
                Position = 5, UserId = "me5"
            });
            state.Players.Add(8, new GamePlayer
            {
                Position = 8, UserId = "me8"
            });
            var nextPlayer = state.GetNextPlayer(5);

            Assert.AreEqual(8, nextPlayer);
        }
コード例 #2
0
        public void GetsNextWithFoldPredicate()
        {
            var state = new GameTableState();

            state.Players = new Dictionary <int, GamePlayer>();
            state.Players.Add(2, new GamePlayer
            {
                Position = 2,
                UserId   = "me2"
            });
            state.Players.Add(3, new GamePlayer
            {
                Position = 3,
                UserId   = "me3",
                Fold     = true
            });
            state.Players.Add(5, new GamePlayer
            {
                Position = 5,
                UserId   = "me5",
                Fold     = true
            });
            state.Players.Add(8, new GamePlayer
            {
                Position = 8,
                UserId   = "me8"
            });
            var nextPlayer = state.GetNextPlayer(8, player => player.Fold);

            Assert.AreEqual(3, nextPlayer);
        }
コード例 #3
0
        public void GetsNextPlayerInSiquant2()
        {
            var state = new GameTableState();

            state.Players = new Dictionary <int, GamePlayer>();
            state.Players.Add(1, new GamePlayer
            {
                Position = 1, UserId = "me1"
            });
            state.Players.Add(2, new GamePlayer
            {
                Position = 2, UserId = "me2"
            });
            var nextPlayer = state.GetNextPlayer(1);

            Assert.AreEqual(2, nextPlayer);
        }