예제 #1
0
        public Node()
        {
            _gameState = new GameState(3);
            var dealerCards  = _gameState.PlayersCards[_gameState.DealerId];
            var opponentsIds = Enumerable.Range(0, Constants.PlayersCount)
                               .Where(playerId => playerId != PlayerId && playerId != _gameState.DealerId)
                               .ToArray();

            var availableCardsToLet = (_gameState.PlayersCards[PlayerId] | dealerCards);

            var cardsToLet = availableCardsToLet.GetCardsIds()
                             .Shuffle()
                             .Take(2)
                             .Select((cardId, index) => (opponentsIds[index], cardId))
                             .ToArray();

            _gameState.Init(cardsToLet);
            _knowledge = new Knowledge(dealerCards, PlayerId, cardsToLet);
        }
예제 #2
0
 public Node(NodeParams nodeParams)
 {
     _gameState = nodeParams.GameState;
     _knowledge = nodeParams.Knowledge;
 }