Ejemplo n.º 1
0
 // use a card from hand
 public async Task handCall(TextBlock tb, InGame iG, TextBlock usrScr)
 {
     //can only use a card if the card is still there
     if (this.Stndng == false && this.IsTrn && !tb.Text.Equals(""))
     {
         //grab the value of the card from the selected card's textBlock
         int  val = Convert.ToInt16(tb.Text);
         Card crd = null;
         //searching hand array to find User's selected card,
         //place that card on the table, mark as used
         for (int i = 0; i < this.Hand.Length; i++)
         {
             if (this.Hand[i].Val == (val))
             {
                 //found card
                 crd = this.Hand[i];
                 this.Hand[i].IsUsed = true;
                 break;
             }
         }
         //play the hand card
         playCard(crd, false, usrScr);
         iG.printHandCard(TrnCnt, crd.Val, this);
         //checking score, user will automatically stand or bust if score is 20 or more after a hand card
         autoBust(iG);
         //no need for that pesky card value to stay on screen anymore
         tb.Text = "";
     }
 }
Ejemplo n.º 2
0
 // use a card from hand
 public async Task handCall(TextBlock tb, InGame iG, TextBlock usrScr)
 {
     //can only use a card if the card is still there
     if (this.Stndng == false && this.IsTrn && !tb.Text.Equals(""))
     {
         //grab the value of the card from the selected card's textBlock
         int val = Convert.ToInt16(tb.Text);
         Card crd = null;
         //searching hand array to find User's selected card, 
         //place that card on the table, mark as used
         for (int i = 0; i < this.Hand.Length; i++)
         {
             if (this.Hand[i].Val == (val))
             {
                 //found card
                 crd = this.Hand[i];
                 this.Hand[i].IsUsed = true;
                 break;
             }
         }
         //play the hand card
         playCard(crd, false, usrScr);
         iG.printHandCard(TrnCnt, crd.Val, this);
         //checking score, user will automatically stand or bust if score is 20 or more after a hand card
         autoBust(iG);
         //no need for that pesky card value to stay on screen anymore
         tb.Text = "";
     }
 }
Ejemplo n.º 3
0
 //process a card from the hand, make it dissapear from side, and appear on table
 private async Task handDeal(int hndNum, InGame iG)
 {
     if (this.Hand[hndNum].IsUsed == false)
     {
         prcesCrd(this.Hand[hndNum]);
         //animate hand card
         await iG.srchGrid(this);
         setHnd(hndNum); 
         
         iG.printHandCard(this.TrnCnt, Hand[hndNum].Val, this);
     }
 }
Ejemplo n.º 4
0
        //process a card from the hand, make it dissapear from side, and appear on table
        private async Task handDeal(int hndNum, InGame iG)
        {
            if (this.Hand[hndNum].IsUsed == false)
            {
                prcesCrd(this.Hand[hndNum]);
                //animate hand card
                await iG.srchGrid(this);

                setHnd(hndNum);

                iG.printHandCard(this.TrnCnt, Hand[hndNum].Val, this);
            }
        }