public void Meets() { Assert.IsTrue(target.Meets(target)); Assert.IsFalse(allLess.Meets(target)); Assert.IsTrue(allGreater.Meets(target)); Assert.IsFalse(mixed.Meets(target)); }
/// <Summary> /// A new area has been selected for research. Make a note of where the research /// resources are now going to be spent. /// </Summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A <see cref="EventArgs"/> that contains the event data.</param> private void CheckChanged(object sender, EventArgs e) { if (dialoginitialized == false) { return; } RadioButton button = sender as RadioButton; if (button != null && button.Checked == true) { try { clientState.EmpireState.ResearchTopics[targetArea] = 0; targetArea = (TechLevel.ResearchField)Enum.Parse(typeof(TechLevel.ResearchField), button.Text, true); clientState.EmpireState.ResearchTopics[targetArea] = 1; } catch (System.ArgumentException) { Report.Error("ResearchDialog.cs : CheckChanged() - unrecognised field of research."); } } // Populate the expected research benefits list AllComponents allComponents = new AllComponents(); TechLevel oldResearchLevel = currentLevel; TechLevel newResearchLevel = new TechLevel(oldResearchLevel); newResearchLevel[targetArea] = oldResearchLevel[targetArea] + 1; researchBenefits.Items.Clear(); foreach (Nova.Common.Components.Component component in allComponents.GetAll.Values) { if (!oldResearchLevel.Meets(component.RequiredTech) && newResearchLevel.Meets(component.RequiredTech)) { string available = component.Name + " " + component.Type; researchBenefits.Items.Add(available); } } ParameterChanged(null, null); }