void Go(bool one_session) { if (!BuildRunInfo(one_session)) { return; } ori.BeginRun(); { // setup ball data interface to support colored balls. ori.ball_data_interface = new BallData_Random75(75); if (ori.colored_balls > 0) { int[] newballs = new int[ori.colored_balls]; int n; for (n = 0; n < ori.colored_balls; n++) { newballs[n] = -1 - n; } ori.ball_data_interface.AddExtraBalls(newballs); } } RunDetails rd = new RunDetails(ori, Convert.ToInt32(this.textBoxThreadCount.Text)); rd.ShowDialog(); rd.Dispose(); ori = null; }
public Form1() { DataRow[] drarray; BingoSQLTracking.BingoTracking.disable = true; schedule = new ScheduleDataSet(StaticDsnConnection.dsn); schedule.Create(); schedule.Fill(); schedule.patterns.DefaultView.Sort = "pattern_name ASC"; schedule.sessions.DefaultView.Sort = "session_name ASC"; patterns = new Patterns(schedule); ori = new OddsRunInfo( ); InitializeComponent(); Cardsets = new DataTable(); Cardsets.TableName = "Cardset"; Cardsets.Columns.Add("Name", typeof(String)); Cardsets.Columns.Add("filename", typeof(string)); Cardsets.Columns.Add("original_row", typeof(DataRow)); DataRow drx = Cardsets.NewRow(); drx[0] = "<No Dealers Found>"; drx[1] = null; Cardsets.Rows.Add(drx); foreach (DataRow row in schedule.cardset_ranges.Rows) { DataRow dr = Cardsets.NewRow(); dr[0] = row[OpenSkieScheduler3.BingoGameDefs.CardsetRange.NameColumn]; // skip the ',' string object o = row.GetParentRow(CardsetRange.CardsetInfoRelationName)["name"]; if (o == null) { dr[1] = DBNull.Value; } else { dr[1] = o; } dr[2] = row; Cardsets.Rows.Add(dr); } Cardsets.AcceptChanges(); PoplateGameTable(); }
bool BuildRunInfo(bool one_session) { if (ori == null) { ori = new OddsRunInfo( ); } #if this_loaded_player_tracking_for_phsycial_players BingoPlayers players = new BingoPlayers(); DbDataReader reader = StaticDsnConnection.KindExecuteReader("select card,sum(value) from player_track where bingoday=" + MySQLDataTable.MakeDateOnly(result.bingoday.AddYears(2006).AddDays(7).AddMonths(5)) + " and session=" + (_sessions + 1) + " and card<>'000000000000000000'" + " group by card"); if (reader.HasRows) { while (reader.Read()) { BingoPlayer player; players.Add(player = new BingoPlayer(reader.GetString(0))); int spend = reader.GetInt32(1); for (int p = 0; p < (spend / 2000); p++) { BingoPack pack = GameList.pack_list.GetPack(true, Cards, "Fictional Pack"); PlayerPack played; pack.pack_set = p; player.played_packs.Add(played = new PlayerPack()); played.pack_info = pack; played.player = player; played.game_list = GameList; } } } #endif if (ori.trigger_stats.enabled = checkBoxTriggerBalls.Checked) { ori.trigger_stats.max_triggered = Convert.ToInt32(textBoxMaxTriggered.Text); ori.trigger_stats.triggered = new int[ori.trigger_stats.max_triggered + 1]; ori.trigger_stats.trigger_wins = new int[ori.trigger_stats.max_triggered + 1]; } if (one_session) { ori.Years = 1; ori.Days = 1; ori.Sessions = 1; ori.Halls = 1; ori.Players = Convert.ToInt32(textBoxPlayers.Text); ori.Cards = Convert.ToInt32(textBoxCards.Text); // this will be overridden later, if external game grid is used. ori.Games = Convert.ToInt32(textBoxGames.Text); } else { ori.Years = Convert.ToInt32(textBoxYears.Text); ori.Days = Convert.ToInt32(textBoxDays.Text); //move all days into the day counter // the DateTime thing will take just adding days. ori.Days = ori.Years * ori.Days; ori.Years = 1; ori.Sessions = Convert.ToInt32(textBoxSessions.Text); ori.Halls = Convert.ToInt32(textBoxHalls.Text); ori.Players = Convert.ToInt32(textBoxPlayers.Text); ori.Cards = Convert.ToInt32(textBoxCards.Text); // this will be overridden later, if external game grid is used. ori.Games = Convert.ToInt32(textBoxGames.Text); } ori.colored_balls = textBoxColorBallCount.Text.Length > 0 ? Convert.ToInt32(textBoxColorBallCount.Text) : 0; ori.flags.use_blower = radioBallBlower.Checked; ori.flags.database_run = checkBoxDatabase.Checked; ori.flags.save_winning_cards = checkBoxSaveWinningCards.Checked; ori.flags.Count_BINGO_Calls = checkBoxCountBINGOCalls.Checked; ori.flags.countColorBINGO = checkBoxCountColorBINGO.Checked; ori.flags.quickshot = checkBoxQuickshot.Checked; ori.flags.starburst = checkBoxStarburst.Checked; ori.flags.simulate = checkBoxSimulate.Checked; ori.flags.only_simulate = true; // this will be overridden later, if external game grid is used. ori.flags.hotball = checkBoxHotball.Checked; // this will be overridden later, if external game grid is used. ori.flags._5cashball = checkBox5Hotball.Checked; ori.PackSize = Convert.ToInt32(textBoxPackSize.Text); if ((ori.Cards / ori.PackSize) * ori.PackSize != ori.Cards) { ori = null; MessageBox.Show("Cards does not divide by Pack Size evenly..."); return(false); } if (comboBox1.SelectedItem != null) { String name = (comboBox1.SelectedItem as DataRowView).Row["name"].ToString(); if (name != null && name.Length > 0) { try { DataRow row = (comboBox1.SelectedItem as DataRowView).Row; DataRow original = row["original_row"] as DataRow; if (original != null) { ori.dealer = BingoDealers.GetDealer(original); } //ori.cardreader = new CardReader( row["original_row"] as DataRow ); //if( ori.cardreader.Length != 0 ) // ori.flags.cardfile = true; } catch { } } else { ori.dealer = BingoDealers.nodealer; } } else { ori.dealer = BingoDealers.nodealer; } if (!LoadGameInfoFromGrid()) { return(false); } return(true); }