Esempio n. 1
0
 private void RemoveListeners()
 {
     for (int i = 14; i < 18; i++)
     {
         lblArr[i].Click -= CallForm_Click;
     }
     lblArr[20].Click -= CallForm_Click;
     stringSuite       = Text.Split(' ')[1];
     lblArr[18].Text   = "Current Call:  " + GameC.GetSuiteShape(stringSuite);
 }
Esempio n. 2
0
        private void CallForm_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 14; i++)
            {
                if ((Label)sender == lblArr[i])
                {
                    stringBids = lblArr[i].Text;

                    if (!title.Equals("Place your call", StringComparison.CurrentCultureIgnoreCase))
                    {
                        if (Convert.ToInt32(stringBids) > Convert.ToInt32(title.Split(' ')[0]))
                        {
                            return; // to unable the user to make bids more than the call bids
                        }
                    }
                    if (stringSuite != null)
                    {
                        stringSuite = GameC.GetSuiteShape(stringSuite);
                    }
                    lblArr[18].Text = "Current Call: " + stringBids + stringSuite;
                    return;
                }
            }
            for (int i = 14; i < 18; i++)
            {
                if ((Label)sender == lblArr[i])
                {
                    stringSuite = GameC.GetSuiteShape(lblArr[i].Text);

                    lblArr[18].Text = "Current Call: " + stringBids + stringSuite;
                    lblNumber       = i;
                    return;
                }
            }
            if ((Label)sender == lblArr[19])
            {
                if (!title.Equals("Place your call", StringComparison.CurrentCultureIgnoreCase))
                {
                    SendBids(Convert.ToInt32(stringBids));
                    Close();
                    return;
                }

                GameC.Suites suite = (GameC.Suites)lblNumber - 14;
                int          bids  = Convert.ToInt32(stringBids);
                call = new Call(suite, bids);
                SendCall(call);
                return;
            }

            if ((Label)sender == lblArr[20])
            {
                SendCall(new Call());
            }
        }