Ejemplo n.º 1
0
        private void DealPlayerCards(Game game)
        {
            // Get Players of the game
            IEnumerable <Player> players = GetPlayers(game.Id);

            List <int> cards = game.Cards.ToList();

            foreach (Player player in players)
            {
                player.Cards = cards.Take(CardsUtility.PLAYER_HAND_CAPCACITY);
                cards.RemoveRange(0, CardsUtility.PLAYER_HAND_CAPCACITY);

                // update player
                _playerCache.Update(player.Id, player);
            }

            game.Cards = cards;
        }
Ejemplo n.º 2
0
 public void Update(int playerId, Player data)
 {
     _playerCache.Update(playerId, data);
 }