Ejemplo n.º 1
0
 public void ShowCard(Card c)
 {
     Write(c.Type);
     Console.Write(c.Name);
     Console.Write(' ');
 }
Ejemplo n.º 2
0
        public void RecordOutCard(Card card)
        {
            OutCards.Add(card);

            if (OutCards.Count % BridgeSet.Players == 0)
            {
                int maxCard = OutCards.Count - BridgeSet.Players;
                for (int i = OutCards.Count - BridgeSet.Players + 1; i < OutCards.Count ; i++)
                {
                    var c = OutCards[i];

                    if (c.Type == OutCards[maxCard].Type && c.Value > OutCards[maxCard].Value)
                    {
                        maxCard = i;
                    }
                }

                var winner = (PlayerPosition)(((int)this.TurnStarter + maxCard % 4) % 4);
                this.TurnWinners.Add(winner);
            }
        }