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 button1_Click(object sender, EventArgs e) { //session_event dataGridViewGames.SelectionMode = DataGridViewSelectionMode.FullRowSelect; DataGridViewSelectedRowCollection rows = dataGridViewGames.SelectedRows; foreach (DataGridViewRow row in rows) { //BingoGame game = row. [ 0 , 1 ] as BingoGame; BingoGameState s = session_event.BingoGameEvents[Convert.ToInt32(row.Cells["GameID"].Value)]; //game.game_ID ); //BingoSession.BingoSessionEvent game_event = s as BingoSession.BingoSessionEvent; session_event.Play(s); CardBrowsingForm info = new CardBrowsingForm(s); info.ShowDialog(); } }
void EltaninReceiver_GameChanged(int new_Game) { //this needs to have an option. if (true) { return; } //---------------------------------------------- // FIX //---------------------------------------------- if (playing_session == null) { return; } Log.log("New game " + new_Game); if (new_Game != old_game) { if (old_game > 0) { UpdateStatus("Reloading players in session " + playing_session.session_number + " and game " + old_game); try { //playing_session.PlayerList //playing_session.ReloadPlayers(/* pack_sequence */); // make sure the players are up to date... /* * for( int p = 0; p < 60; p++ ) * playing_session.PlayerList.Add( new BingoPlayer() ); */ BingoGameState s = playing_session.StepToReplay(old_game); if (s.valid) { UpdateStatus("Playing session " + playing_session.session_number + " and game " + old_game); playing_session.Play(s); while (playing_session.Active) { Thread.SpinWait(1); } UpdateStatus("Calculating session " + playing_session.session_number + " and game " + old_game); if (BingoGameCore4.RateRank.Calculate(s)) { UpdateStatus("Writing session " + playing_session.session_number + " and game " + old_game); StateWriter.DumpState(s, false, false); } else { UpdateStatus("Game did not get ranked, not writing."); } } else { UpdateStatus("Skiping game... not playing it."); } } catch (Exception e) { Log.log("Outermost catcher caught exception - " + e.StackTrace); Log.log("Timer will resume at least..."); Log.log(e.Message); } } old_game = new_Game; } // Scan prior game... //throw new Exception( "The method or operation is not implemented." ); }