public MainWindow(WorldState.Difficulty difficulty, int toursMaximum = int.MaxValue) { this.w = new WorldState(difficulty, "..\\..\\Logres.xml"); this.toursMaximum = toursMaximum; InitializeComponent(); this.Size = new System.Drawing.Size(820, 620); initialisation(); }
/// <summary> /// Called after loading to activate the difficulty-dependent values /// </summary> /// <param name="diff">The selected difficulty</param> internal void ActivateForDiff(WorldState.Difficulty diff) { if (Active == false && tmpDifficulty != null) { switch (tmpDifficulty.ToLower()) { case "easy": Active = diff == WorldState.Difficulty.Easy; break; case "medium": Active = diff < WorldState.Difficulty.Hard; break; case "hard": Active = true; break; default: break; } } }
private void HardButton_Click(object sender, EventArgs e) => Difficulty = WorldState.Difficulty.Hard;
private void MidButton_Click(object sender, EventArgs e) => Difficulty = WorldState.Difficulty.Medium;
private void EasyButton_Click(object sender, EventArgs e) => Difficulty = WorldState.Difficulty.Easy;