public BuyInForm(UserInfo user, TableParams parms)
 {
     InitializeComponent();
     lblAccountMoney.Text = Resources.BuyInForm_BuyInForm_Dollar + user.TotalMoney;
     lblMoneyUnit.Text = Resources.BuyInForm_BuyInForm_Dollar + parms.MoneyUnit;
     lblMin.Text = Resources.BuyInForm_BuyInForm_Dollar + parms.Lobby.MinimumAmountForBuyIn;
     lblMax.Text = Resources.BuyInForm_BuyInForm_Dollar + Math.Min(parms.Lobby.MaximumAmountForBuyIn, user.TotalMoney);
     nudBuyIn.Minimum = parms.Lobby.MinimumAmountForBuyIn;
     nudBuyIn.Maximum = (decimal)Math.Min(parms.Lobby.MaximumAmountForBuyIn, user.TotalMoney);
     nudBuyIn.Increment = parms.MoneyUnit;
     nudBuyIn.Value = parms.Lobby.MinimumAmountForBuyIn;
 }
        public static void Compare(TableParams t, TableParams dt)
        {
            Assert.AreEqual(t.GetType(), dt.GetType());

            Assert.AreEqual(t.GameType, dt.GameType);
            Assert.AreEqual(t.MoneyUnit, dt.MoneyUnit);
            Assert.AreEqual(t.MaxPlayers, dt.MaxPlayers);
            Assert.AreEqual(t.MinPlayersToStart, dt.MinPlayersToStart);
            Assert.AreEqual(t.TableName, dt.TableName);
            Assert.AreEqual(t.Variant, dt.Variant);
            CompareBlindOptions.Compare(t.Blind, dt.Blind);
            CompareLimitOptions.Compare(t.Limit, dt.Limit);
            CompareLobbyOptions.Compare(t.Lobby, dt.Lobby);
            CompareConfigurableWaitingTimes.Compare(t.WaitingTimes, dt.WaitingTimes);
        }
        public CreateTableForm(string playerName, LobbyTypeEnum lobby, IEnumerable<RuleInfo> rules)
        {
            Params = null;
            InitializeComponent();
            var availablesRules = rules.Where(r => r.AvailableLobbys.Contains(lobby));

            var infos = availablesRules as RuleInfo[] ?? availablesRules.ToArray();
            foreach (var type in infos.Select(r => r.GameType).Distinct())
            {
                var t = type.ToString();
                var tp = new TabPage(t) { Name = "tab" + t, BackColor = Color.White };
                tp.Controls.Add(new CreateTableTabControl(playerName, lobby, type, infos.Where(r => r.GameType.ToString() == t)) { Dock = DockStyle.Fill });
                tabControl1.TabPages.Add(tp);
            }
        }
 public PokerTable(TableParams parms)
     :base(parms)
 {
     NewArrivals = new List<PlayerInfo>();
 }
 private void btnAddTable_Click(object sender, EventArgs e)
 {
     Params = tabControl1.SelectedTab.Controls.OfType<CreateTableTabControl>().First().Params;
     Close();
 }
 public PokerTable(TableParams parms)
 {
     Params = parms;
     NewArrivals = new List<PlayerInfo>();
     HadPlayers = false;
 }
 public static void LogTableCreated(int id, TableParams p)
 {
     TableCreated(new StackFrame(1), new LogTableCreationEventArg(id, p));
 }
 public LogTableCreationEventArg(int id, TableParams p) : base(id)
 {
     Params = p;
 }