Esempio n. 1
0
        public BingoSessionEvent(BingoSession base_session, bool create_playerlist)
        {
            session = base_session;

            //game_group_list = game_groups;
            session_number = base_session.session;
            bingoday       = base_session.bingoday;
            if (create_playerlist)
            {
                _PlayerList = new BingoPlayers(this);
            }
        }
Esempio n. 2
0
        public BingoSessionEvent(BingoSession base_session, BallDataInterface bdi)
        {
            session   = base_session;
            ball_data = bdi;

            //game_group_list = game_groups;

            session_number = base_session.session;

            bingoday = base_session.bingoday;

            _PlayerList = new BingoPlayers(this);
        }
Esempio n. 3
0
        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);
        }