private void Form1_Load(object sender, EventArgs e) { BingoGameCore.BingoSession session = new BingoSession(); //session.win //session. }
private void button1_Click(object sender, EventArgs e) { session = new BingoSession(schedule, DateTime.Now, 1); session_event = new BingoSessionEvent(session, true); session_event.Open(); //session_event.ReloadPlayers(); listBox1.Items.Add("Loaded " + session_event.PlayerList.Count + " Player" + ((session_event.PlayerList.Count == 1)?"":"s")); }
private void button6_Click(object sender, EventArgs e) { try { session = new BingoSession(schedule, DateTime.Now, 1); } catch { return; } session_event = new BingoSessionEvent(session, true); session_event.Open(); int n; BingoPack[] play_packs = SelectPacks.Show(session_event); for (n = 0; n < 150; n++) { BingoPlayer player; session_event.PlayerList.Add(player = new BingoPlayer(n.ToString("0:00000"))); PlayerTransaction transaction; player.transactions.Add(transaction = new PlayerTransaction(player, n)); PlayerPack[] packs = new PlayerPack[play_packs.Length]; int z = 0; foreach (BingoPack pack in play_packs) { packs[z++] = session_event.session.GameList.pack_list.GetPlayerPacks(pack.name, "Pos 1")[0]; } if (packs != null) { foreach (PlayerPack pack in packs) { pack.player = player; pack.unit_number = 1001 + n; transaction.Add(pack); player.played_packs.Add(pack); } } else { MessageBox.Show("Probably need to edit the schedule to assign new pack to a game group"); } } // commit all players, their transactions and packs to the game event database. session_event.StorePlayers(); listBox1.Items.Add("Loaded " + session_event.PlayerList.Count + " Player" + ((session_event.PlayerList.Count == 1) ? "" : "s")); }
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) { DataRowView drv = listBox1.SelectedItem as DataRowView; if (drv != null) { currents.SetCurrentSession(drv.Row); session = new BingoSession(drv.Row); session_event = new BingoSessionEvent(session, true); session_event.SaveToDatabase = true; session_event.Open(); UpdatePacks(); } }
private void button3_Click(object sender, EventArgs e) { // play cards vs db... BingoSession session = new BingoSession(); Pattern p = new Pattern(); p.algorithm = OpenSkieScheduler3.PatternDescriptionTable.match_types.CrazyMark; p.repeat_count = 24; p.crazy_hardway = true; BingoGame game; session.GameList.Add(game = new BingoGame(new BingoGameCore4.Pattern[] { p })); BingoGameGroup game_group = new BingoGameGroup(Guid.Empty); game_group.Add(game); BingoPacks packs = new BingoPacks(session.GameList, schedule, null); BingoGameCore4.CardMaster.CardReader card_file = new BingoGameCore4.CardMaster.CardReader("c:\\ftn3000\\data\\cards\\Random 360k (50s300w)(81_Full).20110225.dat"); BingoDealer dealer = BingoDealers.GetDealer(card_file, 1, 1); packs.CreatePack(dealer, "Test Pack"); BingoPack pack = packs.MakePack("Test Pack", card_file.Length); BingoSessionEvent session_evnet = new BingoSessionEvent(session, true); BingoPlayer player; player = new BingoPlayer(); PlayerTransaction transaction; player.transactions.Add(transaction = new PlayerTransaction(player, 12345689)); player.PlayPack(transaction, pack); session_evnet.PlayerList.Add(player); BallDataExternal bde = new BallDataExternal(); session_evnet.ball_data = bde; BingoGameState game_state = session_evnet.StepTo(0); bde.Balls = calls[0]; session_evnet.Play(game_state); }
private void buttonInspect_Click(object sender, EventArgs e) { int session = GetSession(); if (session > 0) { try { this_session = new BingoSession(schedule, the_day, session); UpdateStatus("Inspecting Session: " + this_session.session_name.ToString() + "..."); } catch { return; } } else { MessageBox.Show("Cannot open session " + session); return; } //#if null try { playing_session = new BingoSessionEvent(this_session, true); } catch (Exception session_exception) { Log.log(session_exception.Message); return; } { playing_session.LoadPlayers(); RunSession(false); //playing_session.Play(); while (playing_session.Active) { Thread.SpinWait(100); } CardBrowsingForm sb = new CardBrowsingForm(playing_session); sb.ShowDialog(); } //#endif // SessionBrowser sb = new SessionBrowser( schedule, this_session ); // sb.ShowDialog(); }
public static PackDNA GetPackDNA(BingoSession session) { PackDNA pack_sequence = new PackDNA(); if (pack_config == null) { pack_config = new PackConfiguration(session.schedule.schedule_dsn); } DataRow session_row = session.schedule.GetSession(session.bingoday, session.session); if (session_row != null) { DataRow[] packs = pack_config.Select(SessionTable.PrimaryKey + "=" + session_row[SessionTable.PrimaryKey]); foreach (DataRow pack in packs) { pack_sequence.pack_sequence.Add(session.GameList.pack_list.GetPack(pack["pack_name"] as String, (String)null)); } } return(pack_sequence); }
void bingo_game_core_data_SessionChanged(int session_number) { if (bingo_game_state != null) { //delete bingo_game_state; } if (_session == session_number) { return; } _session = session_number; try { this.session = new BingoSession(schedule, bingoday, session_number); this.session_event = new BingoSessionEvent(this.session, null); } catch { this.session = null; } }
public SessionBrowser(ScheduleDataSet schedule, BingoSessionEvent session) //DataRow dataRow_BingoGame ) { this.session = session.session; this.session_event = session; InitializeComponent(); }
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 } }