Ejemplo n.º 1
0
 private void OnPlayerHandChanged(object sender, PlayerHandChangedEventArgs e)
 {
     _playersHands.AddOrUpdate(e.PlayerId,
         hand => new List<int> {e.Card},
         (key, hand) =>
         {
             if (e.CardAdded)
                 hand.Add(e.Card);
             else
                 hand.Remove(e.Card);
             return hand;
         });
 }
Ejemplo n.º 2
0
 private void OnPlayerHandChanged(object sender, PlayerHandChangedEventArgs e)
 {
     Player player = GetPlayer(e.PlayerId);
     if (e.CardAdded)
     {
         player.EventsHandler.CardAdded(e.Card);
     }
     else
     {
         player.EventsHandler.CardRemoved(e.Card);
     }
 }