示例#1
0
        protected GameManager(DrinctetStatus status)
        {
            Status = status;

            switch (status.SelectionAlgorithm)
            {
            case SelectionAlgorithm.Benokla:
                Selection = new BenokolaAlgorithm();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            Selection.Initialize(status, Random);
        }
示例#2
0
        public void TestSelectPlayers(RequiredGender[] requiredGenders, PlayerInfo[] players, int[] expectedPlayers)
        {
            _algorithm.Initialize(
                new DrinctetStatus
            {
                Players            = players,
                PlayerScores       = players.ToDictionary(x => x.Id, x => 10),
                PlayerArrangements = new Dictionary <int, int>()
            }, new Random());

            var result = _algorithm.SelectPlayers(requiredGenders, new CardTag[0]);

            Assert.Equal(expectedPlayers.Length, result.Count);

            for (int i = 0; i < expectedPlayers.Length; i++)
            {
                var expectedId = expectedPlayers[i];
                Assert.Equal(expectedId, result[i].Id);
            }
        }