protected override void Evaluate()
        {
            if (Parameters.Count != 2)
            {
                throw new Exception(string.Format("Expected 2 parameters, got {0} in function name {1}.",
                                                  Parameters.Count, Text));
            }

            var vertical = ParameterTextParser.ReadBoolean(Parameters[0], new [] { "vertical", "v" }, new [] { "horizontal", "h" });
            var offset   = ParameterTextParser.ReadInt(Parameters[1]);

            if (vertical)
            {
                Settings.VerticalWindowOffset = offset;
            }
            else
            {
                Settings.HorizontalWindowOffset = offset;
            }
        }
示例#2
0
        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();
        }