protected override void Evaluate() { if (Parameters.Count != 1) { throw new Exception(string.Format("Expected 1 parameter, got {0} in function name {1}.", Parameters.Count, Text)); } ParameterTextParser.ValidateStringAgainstSet(Parameters[0], new[] { "all" }.Concat(_categories).ToArray()); var output = ""; UIMap.PopulationAndProduction.MakeActive(); UIMap.PopulationAndProduction.SelectResearchTab(); output += "Available Labs: " + UIMap.PopulationAndProduction.AvailableLabs.Text + "\n\n"; if (Parameters[0] == "all") { foreach (var cat in _categories) { UIMap.PopulationAndProduction.SelectResearchByCategory(cat); output += ReadResearchTables(); } } else { UIMap.PopulationAndProduction.SelectResearchByCategory(Parameters[0]); output += ReadResearchTables(); } Messages.AddMessage(MessageType.Information, output); }
protected override void Evaluate() { if (Parameters.Count != 4) { throw new Exception(string.Format("Expected 4 parameters, got {0} in function name {1}.", Parameters.Count, Text)); } ParameterTextParser.ValidateStringAgainstSet(Parameters[0], _categories); var technologyNumber = ParameterTextParser.ReadInt(Parameters[1]); var scientistNumber = ParameterTextParser.ReadInt(Parameters[2]); var numberOfLabs = ParameterTextParser.ReadPositiveInt(Parameters[3]); UIMap.PopulationAndProduction.MakeActive(); UIMap.PopulationAndProduction.SelectResearchTab(); UIMap.PopulationAndProduction.SelectResearchByCategory(Parameters[0]); UIMap.PopulationAndProduction.MatchingScientistsOnly.Select(); UIMap.PopulationAndProduction.SelectNthResearch(technologyNumber); UIMap.PopulationAndProduction.SelectNthScientist(scientistNumber); UIMap.PopulationAndProduction.SetAllocatedLabs(numberOfLabs + ""); UIMap.PopulationAndProduction.CreateResearch(); }