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; }
public void Update(int playerId, Player data) { _playerCache.Update(playerId, data); }