void DoPlay() { BingoGameState s; while (true) { s = this.Step(); BingoGameEvents.Add(s); if (s.valid) { session.UpdateStatus("Checking game " + s.game.game_number + "(" + s.game.game_ID + ")" + " in session " + session_number + " on " + bingoday.Date + "..."); if (StateWriter.CheckState(ref s)) { session.UpdateStatus("Playing game " + s.game.game_number + "(" + s.game.game_ID + ")" + " in session " + session_number + " on " + bingoday.Date + "..."); //status.Refresh(); BingoMatchEngine.Play(s); } else { //MessageBox.Show( "Game:" + s.game.game_number + " in Session:" + ( GameList.session ) + " on " + GameList.bingoday + " has already been rated...\nIgnoring" ); } } else { break; } } if (s.game != null) { session.UpdateStatus("Game completed " + s.game.game_number + "(" + s.game.game_ID + ")" + " in session " + session_number + " on " + bingoday.Date + "..."); } //status.Refresh(); }
//static int play_lock; /// <summary> /// Plays a single bingo event. /// </summary> /// <param name="State">the state to play - should have used a 'Step' function to get this</param> public void PlayGame(BingoGameState State) { BingoMatchEngine.Play(State); if (opened) { BingoPrize.ComputePrizes(State.game_event, State.game, State.winning_cards); foreach (wininfo win in State.winning_cards) { Local.bingo_tracking.AddWinner(win.playing_card.ID, win.mask, win.amount); } } }
public void DoPlayState(object param) { BingoGameState s = param as BingoGameState; if (s.valid) { session.UpdateStatus("Playing game " + s.game.game_number + "(" + s.game.game_ID + ")" + " in session " + session_number + " on " + bingoday.Date + "..."); BingoMatchEngine.Play(s); session.UpdateStatus("Game completed " + s.game.game_number + "(" + s.game.game_ID + ")" + " in session " + session_number + " on " + bingoday.Date + "..."); } else { session.UpdateStatus("Invalid state. Ignoring."); } }