Exemple #1
0
 private void AddDownCard(CardStr card)
 {
     DownCards.Add(card);
     Card newCard = new Card(card);
     newCard.Size = CardSize;
     newCard.BackColor = CardBackGroundColor;
     newCard.Enabled = false;
     newCard.Location = new Point((CardSize.Width + 5) * (DownCards.Count - 1) + 10, 170);
     newCard.Name = "Downcard_" + DownCards.Count;
     newCard.player = Players.None;
     addControl(newCard);
     tofrontControl("Downcard_" + DownCards.Count);
     if (DownCards.Count > 6) {
         for (int c = 1; c <= DownCards.Count; c++) {
             relocateControl("Downcard_" + c, new Point(10 + (int)((c - 1) * ((float)CardSize.Width * (float)(6 / (float)DownCards.Count))), 170));
         }
     }
 }
Exemple #2
0
 private void TakeCard(CardStr card)
 {
     PlayerCards.Add(card);
     Card newCard = new Card(card);
     newCard.Size = CardSize;
     newCard.BackColor = CardBackGroundColor;
     newCard.Enabled = false;
     newCard.Click += new EventHandler(newCard_Click);
     newCard.Name = "Card_" + PlayerCards.Count;
     newCard.Location = new Point((CardSize.Width + 5) * (PlayerCards.Count - 1) + 10, 30);
     newCard.player = Players.Player1;
     this.Controls.Add(newCard);
 }
Exemple #3
0
        private void oppTakeCard()
        {
            oppCards++;
            Card newCard = new Card();
            newCard.Size = CardSize;
            newCard.BackColor = CardBackGroundColor;
            newCard.Enabled = false;
            newCard.Hidden = true;

            newCard.Name = "oppCard_" + oppCards;
            newCard.Location = new Point((CardSize.Width + 5) * (oppCards - 1) + 10, 290);
            newCard.player = Players.Player2;
            this.Controls.Add(newCard);
        }