示例#1
0
        public void TechnologyEffectDescriber_WhenDescribing_Should_ReturnEmptyListWhenUnknownTechType()
        {
            var fakeTech    = new TechObject();
            var description = TechnologyEffectDescriber.GetDescriptionList(fakeTech);

            Assert.IsFalse(description.Any());
        }
示例#2
0
        public void TechnologyEffectDescriber_WhenDescribing_Should_ReturnCorrectDescriptionFor_EnginePower()
        {
            var testTech = new TechObject()
            {
                TechType       = AuroraTechTypes.EnginePower,
                AdditionalInfo = 500.0
            };
            var description = TechnologyEffectDescriber.GetDescriptionList(testTech);

            Assert.AreEqual(TechEffectEnum.EnginePowerPerHs, description[0].EffectType);
            Assert.AreEqual("500.0 Engine Power per HS of Engine Size", description[0].Description);
        }
        public static List <string> EffectsOfTheTech(TechObject theTechToAnalyse)
        {
            var effectList = TechnologyEffectDescriber.GetDescriptionList(theTechToAnalyse);

            var effects = new List <string>();

            foreach (var effectDescription in effectList)
            {
                var effectSummary = "";
                if (_effectSummary.ContainsKey(effectDescription.EffectType))
                {
                    effectSummary = _effectSummary[effectDescription.EffectType];
                }

                effects.Add($"{effectSummary} : {effectDescription.Description}");
            }

            return(effects);
        }