Esempio n. 1
0
 private void SpecialCardDiscardedHandler(object sender, SpecialCardDiscardedEventArgs e)
 {
     CardColor chosenColor = CardColor.Black;
     if (e.SpecialCardType == CardType.Wild || e.SpecialCardType == CardType.WildDrawFour)
     {
         var wildCardDiscardedEventArgs = new WildCardDiscardedEventArgs(CurrentPlayer);
         WildCardDiscarded.Invoke(this, wildCardDiscardedEventArgs);
         chosenColor = wildCardDiscardedEventArgs.Color;
     }
     switch (e.SpecialCardType)
     {
         case CardType.Reverse: _reverse = !_reverse; break;
         case CardType.DrawTwo:
         {
             NextPlayer();
             CurrentPlayer.AddCards(_uno.DrawCards(2));
             break;
         }
         case CardType.Skip: NextPlayer(); break;
         case CardType.Wild: e.ChoosenColor = chosenColor; break;
         case CardType.WildDrawFour:
         {
             e.ChoosenColor = chosenColor;
             NextPlayer();
             CurrentPlayer.AddCards(_uno.DrawCards(4));
             break;
         }
     }
 }
Esempio n. 2
0
 private void OnWildCardDiscarded(object sender, WildCardDiscardedEventArgs e)
 {
     ToClientWithName(e.Player.Name).chooseColor();
 }