public void AddComSelection(BetStyle betStyle) { string text = betStyle.GetDescription(); this.comboBox1.Items.Add(new ComBetItem { Text = text, Value = betStyle }); }
private void button1_Click(object sender, EventArgs e) { if (betCallBack != null) { BetStyle style = ((ComBetItem)this.comboBox1.SelectedItem).Value; BetJettons = (style == BetStyle.HalfOfTotalPot || style == BetStyle.AllOfTotalPot) ? 0 : ResolvBetAction(style); //ShowInfo(String.Format("下注:{0}", BetJettons)); betCallBack(style, BetJettons); } }
private int ResolvBetAction(BetStyle style) { int result = 0; switch (style) { case BetStyle.HalfOfCurrentPot: //result = Convert.ToInt32(currentPot / 2); result = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(currentPot) / 200) * 100); break; case BetStyle.HalfOfTotalPot: result = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(totalPot.PotJettons) / 200) * 100); break; case BetStyle.LeaveOfCurrentPot: result = Convert.ToInt32(currentPot - bettedJettons); break; //case BetStyle.LeaveOfTotalPot: // result = Convert.ToInt32(totalPot - currentPot / 2); // break; case BetStyle.AllOfCurrentPot: result = Convert.ToInt32(currentPot); break; case BetStyle.AllOfTotalPot: result = Convert.ToInt32(totalPot.PotJettons); break; case BetStyle.Cardinal: result = cardinal; break; case BetStyle.Custom: result = Convert.ToInt32(this.textBox1.Text); break; default: result = 100; break; } return(result); }
public PokerGameBetContext(BetStyle style, int betJettons) { }