/// <summary> /// OK button handler /// </summary> /// <param name="sender">Ignored</param> /// <param name="e">Ignored</param> private void buttonOk_Click(object sender, EventArgs e) { // Capture the elements needed for the game // 1] Player Color PieceColor playerColor = PieceColor.White; RadioButton playerButton = RadioButtonHelper.GetCheckedRadio(groupBoxPlayerColor); // There are only 2 options, so change if it's black if (playerButton == radioButtonBlack) { playerColor = PieceColor.Black; } // 2] Think time for chess engine int engineThinkTime = (int)numericUpDownThinkTime.Value; newGameInfo = new NewGameInfo(playerColor, engineThinkTime); // 3] Optional FEN if (dialogType == NewGameType.PositionalFEN) { newGameInfo.FEN = textBoxFEN.Text; } Close(); }
void OnButtonStart() { if (PlayerOneSwitch.Name == "" && PlayerTwoSwitch.Name == "") { return; } app.Engine.Blend = 1; GameCreation creation = new GameCreation(app as BurntimeClassic); NewGameInfo Info = new NewGameInfo(); Info.NameOne = PlayerOneSwitch.Name; Info.NameTwo = PlayerTwoSwitch.Name; Info.FaceOne = PlayerOneFace.FaceID; Info.FaceTwo = PlayerTwoFace.FaceID; Info.Difficulty = Difficulty.Value; Info.ColorOne = Color.IsDown ? BurntimePlayerColor.Red : BurntimePlayerColor.Green; Info.ColorTwo = Color.IsDown ? BurntimePlayerColor.Green : BurntimePlayerColor.Red; creation.CreateNewGame(Info); app.SceneManager.SetScene("WaitScene"); }
/// <summary> /// Load in the vehicle party and starting resources. /// </summary> /// <param name="startInfo"></param> internal void SetStartInfo(NewGameInfo startInfo) { var crewNumber = 1; Vehicle.ResetVehicle(startInfo.StartingMoney); foreach (var x in startInfo.PartyClasses) { Vehicle.AddPerson(new Person(x, ((startInfo.PartyClasses.IndexOf(x) == 0) && (crewNumber == 1)))); crewNumber++; } }
/// <summary> /// Attaches the traveling Windows and removes the new game Windows if it exists, this begins the simulation down the /// trail path and all the points of interest on it. /// </summary> /// <param name="startingInfo"> /// User data object that was passed around the new game Windows and populated by user /// selections. /// </param> internal void SetStartInfo(NewGameInfo startingInfo) { // Clear out any data amount items, monies, people that might have been in the vehicle. Vehicle.ResetVehicle(startingInfo.StartingMonies); // Add all the player data we collected from attached game Windows states. var crewNumber = 1; foreach (var name in startingInfo.PlayerNames) { // First name in list is always the leader. var personLeader = (startingInfo.PlayerNames.IndexOf(name) == 0) && (crewNumber == 1); Vehicle.AddPerson(new Person(startingInfo.PlayerProfession, name, personLeader)); crewNumber++; } // Set the starting month to match what the user selected. Time.SetMonth(startingInfo.StartingMonth); }
private void btn_ok_Click(object sender, EventArgs e) { CuloarePiesa culoareajucatorului = CuloarePiesa.Alb; RadioButton butonculoare = RadioButtonHelper.GetCheckedRadio(groupBox1); if (butonculoare == btn_Negru) { culoareajucatorului = CuloarePiesa.Negru; } MarimeTable SizeeL = MarimeTable.Patru; MarimeTable SizeeC = MarimeTable.Patru; if (String.Equals(comboBox1.Text, "5")) { SizeeL = MarimeTable.Cinci; } if (String.Equals(comboBox1.Text, "6")) { SizeeL = MarimeTable.Sase; } if (String.Equals(comboBox1.Text, "7")) { SizeeL = MarimeTable.Sapte; } if (String.Equals(comboBox1.Text, "8")) { SizeeL = MarimeTable.Opt; } if (String.Equals(comboBox1.Text, "9")) { SizeeL = MarimeTable.Noua; } if (String.Equals(comboBox1.Text, "10")) { SizeeL = MarimeTable.Zece; } if (String.Equals(comboBox2.Text, "5")) { SizeeC = MarimeTable.Cinci; } if (String.Equals(comboBox2.Text, "6")) { SizeeC = MarimeTable.Sase; } if (String.Equals(comboBox2.Text, "7")) { SizeeC = MarimeTable.Sapte; } if (String.Equals(comboBox2.Text, "8")) { SizeeC = MarimeTable.Opt; } if (String.Equals(comboBox2.Text, "9")) { SizeeC = MarimeTable.Noua; } if (String.Equals(comboBox2.Text, "10")) { SizeeC = MarimeTable.Zece; } newGameInfo = new NewGameInfo(culoareajucatorului, SizeeC, SizeeL); }