private void Game_OnRoundResult(object sender, RoundEventArgs e) { this.QuestionVisibility = Visibility.Hidden; this.AnswerVisibility = Visibility.Hidden; if (e.Result) { this.VFigureVisibility = Visibility.Visible; } else { this.CorrectAnswer = e.Response; this.XFigureVisibility = Visibility.Visible; this.CorrectAnswerVisibility = Visibility.Visible; } Thread.Sleep(2500); this.CorrectAnswer = ""; this.Answer = ""; this.OnRoundResult(this, null); this.VFigureVisibility = Visibility.Hidden; this.XFigureVisibility = Visibility.Hidden; this.CorrectAnswerVisibility = Visibility.Hidden; this.QuestionVisibility = Visibility.Visible; this.AnswerVisibility = Visibility.Visible; }
void OnGameBettingRoundStarted(object sender, RoundEventArgs e) { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new EventHandler <RoundEventArgs>(OnGameBettingRoundStarted), new[] { sender, e }); return; } SuspendLayout(); var table = m_Game.Table; foreach (var p in table.Players) { m_Huds[p.NoSeat].Alive = true; } var i = 0; for (; i < table.Cards.Length; ++i) { m_Board[i].Card = table.Cards[i]; } for (; i < 5; ++i) { m_Board[i].Card = GameCard.NoCard; } ResumeLayout(); }
private void Game_OnQuestionAppeared(object sender, RoundEventArgs e) { this.Question = e.Request; OnQuestionAppeared(this, null); while (this.Answer == null || this.Answer == "") { } e.Response = this.Answer; }
void OnGameBettingRoundStarted_Console(object sender, RoundEventArgs e) { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new EventHandler <RoundEventArgs>(OnGameBettingRoundStarted_Console), new[] { sender, e }); return; } var table = m_Game.Table; WriteLine("==> Beginning of " + RoundNameFromId(e.Round)); var boardCards = table.Cards.Where(c => c != null && c.Id != GameCard.NoCard.Id).ToArray(); if (boardCards.Any()) { WriteLine("==> Current board cards: " + string.Join(" ", boardCards.Select(c => c.ToString()))); } }