public static PokerHandHistory.Card[] Board(this PokerHand hand, Rounds round) { switch (round) { case Rounds.PREFLOP: return new PokerHandHistory.Card[0]; case Rounds.FLOP: return new PokerHandHistory.Card[] { hand.Flop.CommunityCards[0], hand.Flop.CommunityCards[1], hand.Flop.CommunityCards[2] }; case Rounds.TURN: return new PokerHandHistory.Card[] { hand.Flop.CommunityCards[0], hand.Flop.CommunityCards[1], hand.Flop.CommunityCards[2], hand.Turn.CommunityCards[0] }; case Rounds.RIVER: return new PokerHandHistory.Card[] { hand.Flop.CommunityCards[0], hand.Flop.CommunityCards[1], hand.Flop.CommunityCards[2], hand.Turn.CommunityCards[0], hand.River.CommunityCards[0] }; default: throw new Exception("Unknown round: " + round.ToString()); } }
private void EnterScoreButton_Click(object sender, RoutedEventArgs e) { if (!(String.IsNullOrEmpty(ScoreATextBox.Text) || String.IsNullOrEmpty(ScoreBTextBox.Text))) { ScoreA = Convert.ToInt32(ScoreATextBox.Text); ScoreA = int.Parse(ScoreATextBox.Text); ScoreB = Convert.ToInt32(ScoreBTextBox.Text); ScoreB = int.Parse(ScoreBTextBox.Text); if (((ScoreA + ScoreB) == 0 || (ScoreA + ScoreB) == 100 || (ScoreA + ScoreB) == 200 || (ScoreA + ScoreB) == 300 || (ScoreA + ScoreB) == 400) && (ScoreA % 5 == 0) && (ScoreB % 5 == 0)) { TextBlock _newScoreA = new TextBlock(); _newScoreA.Text = ScoreA.ToString(); _newScoreA.FontSize = 20; _newScoreA.HorizontalAlignment = HorizontalAlignment.Center; ScoreAStackPanel.Children.Add(_newScoreA); TextBlock _newScoreB = new TextBlock(); _newScoreB.Text = ScoreB.ToString(); _newScoreB.FontSize = 20; _newScoreB.HorizontalAlignment = HorizontalAlignment.Center; ScoreBStackPanel.Children.Add(_newScoreB); TotalScoreA += ScoreA; TotalScoreB += ScoreB; TotalAScoreTextBlock.Text = TotalScoreA.ToString(); TotalBScoreTextBlock.Text = TotalScoreB.ToString(); ScoreATextBox.Text = String.Empty; ScoreBTextBox.Text = String.Empty; Rounds++; TextBlock _rounds = new TextBlock(); _rounds.Text = Rounds.ToString(); _rounds.HorizontalAlignment = HorizontalAlignment.Center; _rounds.FontSize = 20; RoundsStackPanel.Children.Add(_rounds); } else { ScoreATextBox.Text = String.Empty; ScoreBTextBox.Text = String.Empty; } } ScoreATextBox.TextChanging += ScoreATextBox_TextChanging; ScoreBTextBox.TextChanging += ScoreBTextBox_TextChanging; //Sqlite part game.A.Score[Rounds] = ScoreA; game.B.Score[Rounds] = ScoreB; game.rounds = Rounds; game.A.calcTotalScore(); game.B.calcTotalScore(); conn.Commit(); }
private void ControlRounds() //Отслеживание текущего раунда { Rounds++; Round.text = "<color=Black>ROUND : " + Rounds.ToString() + "/15</color>"; }
public override void Render(FrameEventArgs e) { GL.MatrixMode(MatrixMode.Projection); GL.LoadIdentity(); GL.Ortho(0, sceneManager.Width, 0, sceneManager.Height, -1, 100); GUI.clearColour = Color.Black; //Display the Title float width = sceneManager.Width, height = sceneManager.Height, fontSize = Math.Min(width, height) / 25f; int middlex = (int)(width / 2), middley = (int)(height / 2); // Draws scene title GUI.Label(new Rectangle(0, (int)(fontSize / 2f), (int)width, (int)(fontSize * 2f)), "Gorillas 3D", (int)fontSize, StringAlignment.Center); GUI.Label(new Rectangle(0, (int)(middley / 2.3f), (int)width, (int)(fontSize * 2.0f)), "1 or 2 players (Default = 1): " + Players, (int)(fontSize * 0.5f), StringAlignment.Center); if(Input > 0) { GUI.Label(new Rectangle(0, (int)(middley / 2.0f), (int)width, (int)(fontSize * 2.0f)), "Name of Player 1 (Default = 'Player 1'): " + Player1, (int)(fontSize * 0.5f), StringAlignment.Center); } if(Input > 1) { GUI.Label(new Rectangle(0, (int)(middley / 1.75f), (int)width, (int)(fontSize * 2.0f)), "Name of Player 2 (Default = 'Player 2'): " + Player2, (int)(fontSize * 0.5f), StringAlignment.Center); } if(Input > 2) { GUI.Label(new Rectangle(0, (int)(middley / 1.55f), (int)width, (int)(fontSize * 2.0f)), "Play to how many total points (Default = 3)? " + Rounds.ToString(), (int)(fontSize * 0.5f), StringAlignment.Center); } if(Input > 3) { GUI.Label(new Rectangle(0, (int)(middley / 1.38f), (int)width, (int)(fontSize * 2.0f)), "Gravity in Meters/sec (Earth = 9.8)? " + Gravity.ToString(), (int)(fontSize * 0.5f), StringAlignment.Center); } if(Input > 4) { GUI.Label(new Rectangle(0, (int)(middley / 1.0f), (int)width, (int)(fontSize * 2.0f)), "----------------", (int)(fontSize * 0.5f), StringAlignment.Center); GUI.Label(new Rectangle(0, (int)(middley / 0.9f), (int)width, (int)(fontSize * 2.0f)), "V = View Intro", (int)(fontSize * 0.5f), StringAlignment.Center); GUI.Label(new Rectangle(0, (int)(middley / 0.85f), (int)width, (int)(fontSize * 2.0f)), "P = Play Game ", (int)(fontSize * 0.5f), StringAlignment.Center); GUI.Label(new Rectangle(0, (int)(middley / 0.75f), (int)width, (int)(fontSize * 2.0f)), "Your Choice? ", (int)(fontSize * 0.5f), StringAlignment.Center); } // Renders UI to screen GUI.Render(); }