コード例 #1
0
        public ReactorFuelType(IEnumerable <ReactorFuelMode> reactorFuelModes)
        {
            Variants = reactorFuelModes.ToList();

            ResourceGroups = new List <ResourceGroupMetaData>();
            foreach (var group in Variants.SelectMany(m => m.ReactorFuels).GroupBy(m => m.FuelName))
            {
                ResourceGroups.Add(new ResourceGroupMetaData()
                {
                    name = group.Key,
                    resourceVariantsMetaData = group.Select(m => new FuelResourceMetaData(m.Definition, m.Ratio)).Distinct().ToList()
                });
            }

            var first = Variants.First();

            Index                       = first.Index;
            ModeGUIName                 = first.ModeGUIName;
            TechLevel                   = first.TechLevel;
            TechRequirement             = first.TechRequirement;
            SupportedReactorTypes       = first.SupportedReactorTypes;
            Aneutronic                  = first.Aneutronic;
            RequiresLab                 = first.RequiresLab;
            RequiresUpgrade             = first.RequiresUpgrade;
            ChargedPowerRatio           = first.ChargedPowerRatio;
            MeVPerChargedProduct        = first.MeVPerChargedProduct;
            NormalisedReactionRate      = first.NormalisedReactionRate;
            NormalisedPowerRequirements = first.NormalisedPowerRequirements;
            NeutronsRatio               = first.NeutronsRatio;
            TritiumBreedModifier        = first.TritiumBreedModifier;
            FuelEfficencyMultiplier     = first.FuelEfficencyMultiplier;
        }
コード例 #2
0
        public void Approve()
        {
            Should(() => _contents.Any(), "Product must have at least one content");
            Should(() => Variants.Any(), "Product must have at least one variant");
            Should(() => Variants.SelectMany(v => v.Images).Any(), "Product must have at least one image");

            ApplyChange(new ProductApproved(Id));
        }
コード例 #3
0
        public ReactorFuelType(IEnumerable <ReactorFuelMode> reactorFuelModes)
        {
            Variants = reactorFuelModes.ToList();

            ResourceGroups = new List <ResourceGroupMetaData>();
            foreach (var group in Variants.SelectMany(m => m.ReactorFuels).GroupBy(m => m.FuelName))
            {
                ResourceGroups.Add(new ResourceGroupMetaData()
                {
                    name = group.Key,
                    resourceVariantsMetaData = group.Select(m => new FuelResourceMetaData(m.Definition, m.Ratio)).Distinct().ToList()
                });
            }

            var first = Variants.First();

            AlternativeFuelType1 = first.AlternativeFuelType1;
            AlternativeFuelType2 = first.AlternativeFuelType2;
            AlternativeFuelType3 = first.AlternativeFuelType3;
            AlternativeFuelType4 = first.AlternativeFuelType4;
            AlternativeFuelType5 = first.AlternativeFuelType5;
            AlternativeFuelType6 = first.AlternativeFuelType6;

            Index                       = first.Index;
            ModeGUIName                 = first.ModeGuiName;
            DisplayName                 = first.DisplayName;
            TechLevel                   = first.TechLevel;
            MinimumFusionGainFactor     = first.MinimumQ;
            TechRequirement             = first.TechRequirement;
            SupportedReactorTypes       = first.SupportedReactorTypes;
            Aneutronic                  = first.Aneutronic;
            Hidden                      = first.Hidden;
            GammaRayEnergy              = first.GammaRayEnergy;
            RequiresLab                 = first.RequiresLab;
            RequiresUpgrade             = first.RequiresUpgrade;
            ChargedPowerRatio           = first.ChargedPowerRatio;
            MeVPerChargedProduct        = first.MeVPerChargedProduct;
            ReactionRatePowerMultiplier = first.ReactionRatePowerMultiplier;
            NormalizedPowerMultiplier   = first.NormalizedPowerMultiplier;
            NormalizedPowerRequirements = first.NormalizedPowerRequirements;
            NeutronsRatio               = first.NeutronsRatio;
            TritiumBreedModifier        = first.TritiumBreedModifier;
            FuelEfficiencyMultiplier    = first.FuelEfficiencyMultiplier;
        }