private void button2_Click(object sender, EventArgs e) { do { game_state = session_event.Step(); if (game_state.valid) { session_event.PlayGame(game_state); foreach (wininfo win in game_state.winning_cards) { listBox1.Items.Add(win.playing_card.ToString()); listBox1.Refresh(); } } }while(game_state.valid); session_event.Close(); }
void SetupNewSession(DateTime the_day, int session) { //if( playing_session == null || playing_session.session_number != session ) { Log.log("Starting new session " + session); // load in the correct session.... this_session = new BingoSession(schedule, the_day, session); playing_session = new BingoSessionEvent(this_session, true); BingoGameCore4.Forms.RatedGameConfigurator.GameConfiguration game_config = new RatedGameConfigurator.GameConfiguration(schedule); DsnSQLUtil.MatchCreate(schedule.schedule_dsn, game_config); game_config.Fill(); foreach (BingoGame game in this_session.GameList) { BingoGameState s = playing_session.Step(); DataRow[] rows = game_config.Select("session_game_id=" + DsnSQLUtil.GetSQLValue(null , schedule.session_games.Columns[SessionGame.PrimaryKey].DataType , game.session_game_id)); if (rows.Length > 0) { game.rate = Convert.ToBoolean(rows[0]["rate"]); } } pack_sequence = RatedPackConfigurator.GetPackDNA(this_session); //playing_session.ReloadPlayers(/* pack_sequence */); #if static_dna { pack_sequence = new PackDNA(); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Blue")); //1 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Blue")); //2 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Blue")); //3 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Blue")); //4 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Red")); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Red")); //5 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Red")); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Red")); //6 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Green")); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Green")); //7 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Green")); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Green")); //8 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Blue")); //9 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Blue")); //10 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Blue")); //11 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Red")); //12 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Red")); //13 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("Free Red")); //14 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Blue")); //15 pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Red")); pack_sequence.pack_sequence.Add(this_session.GameList.pack_list.GetPack("RB Green")); //16 playing_session.ReloadPlayers(pack_sequence); } #endif } }