Example #1
0
        private void RandomizePrices()
        {
            Random rand = StaticRandom.GetRandomForThread();

            RandomBellArgs bell = new RandomBellArgs(1, -45, 1, -45);

            _partPriceAdjustments = BotConstructor.AllPartTypes.Value.
                                    Select(o => Tuple.Create(o, RandomizePrices_Percent(rand, bell))).
                                    ToArray();

            _mineralPriceAdjustments = UtilityCore.GetEnums <MineralType>().
                                       Select(o => Tuple.Create(o, RandomizePrices_Percent(rand, bell))).
                                       ToArray();
        }
Example #2
0
        private static ShipCreateChance[] GetShipChances()
        {
            Random rand = StaticRandom.GetRandomForThread();

            DefaultShipType[] solarTypes = new[]
            {
                DefaultShipType.SolarPack1,
                DefaultShipType.SolarPack2,
                DefaultShipType.SolarPack3,
                DefaultShipType.SolarPack4,
            };

            IEnumerable <ShipCreateChance> standard = UtilityCore.GetEnums <DefaultShipType>(solarTypes).
                                                      Select(o => new ShipCreateChance()
            {
                ShipType = o, ProbabilityPercent = 1d, ScaleBase = 1d
            });

            IEnumerable <ShipCreateChance> solars = solarTypes.
                                                    Select(o => new ShipCreateChance()
            {
                ShipType = o, ProbabilityPercent = .1d, ScaleBase = 1d
            });

            ShipCreateChance[] retVal = standard.
                                        Concat(solars).
                                        ToArray();

            // Mutate Percents
            MutatePercents(retVal, rand);

            // Normalize
            NormalizePercents(retVal);

            return(retVal);
        }