// Add the the players' dice rolls for all categories to the main window. private void AddDiceResults() { for (int i = 0; i < Rules.CategoryCount; i++) { Player1Categories [i] = new DiceContainer(); Player1Categories [i].Left = 400; Player1Categories [i].Top = i * 25 + 47; Player1Categories [i].Size = 20; Player1Categories [i].AddToForm(this); Player2Categories [i] = new DiceContainer(); Player2Categories [i].Left = 560; Player2Categories [i].Top = i * 25 + 47; Player2Categories [i].Size = 20; Player2Categories [i].AddToForm(this); } }
// Initialize and add main game controls to the main window. private void AddMainControls() { CurrentDice = new DiceContainer(); CurrentDice.Left = 25; CurrentDice.Top = 110; CurrentDice.Size = 50; CurrentDice.AddClickHandler(SelectDieClick); CurrentDice.AddToForm(this); ButtonRoll.Left = 25; ButtonRoll.Top = 180; ButtonRoll.Width = 100; ButtonRoll.Height = 30; ButtonRoll.Text = "Roll"; ButtonRoll.Click += RollClick; ButtonRoll.Enabled = false; Controls.Add(ButtonRoll); ButtonRestart.Left = 25; ButtonRestart.Top = 370; ButtonRestart.Width = 100; ButtonRestart.Height = 30; ButtonRestart.Text = "New Game"; ButtonRestart.Click += RestartClick; Controls.Add(ButtonRestart); ButtonHighScores.Left = 150; ButtonHighScores.Top = 370; ButtonHighScores.Width = 100; ButtonHighScores.Height = 30; ButtonHighScores.Text = "High Scores"; ButtonHighScores.Click += HighScoresClick; Controls.Add(ButtonHighScores); LabelStatus.Left = 25; LabelStatus.Top = 50; LabelStatus.Width = 200; LabelStatus.Height = 60; LabelStatus.Text = "Player 1"; Controls.Add(LabelStatus); }