Esempio n. 1
0
 private Var shipBaseVars()
 {
     return(PlayerProcessor.DesignBaseVars(
                new Component <HullType>(this.selectedHull.Type, this.selectedHull.Level),
                this.selectedSpecialEquipment,
                this.game.Statics));
 }
Esempio n. 2
0
        public static double PowerOf(Component <ReactorType> reactor, Component <HullType> hull, IEnumerable <Component <SpecialEquipmentType> > specialEquipment, StaticsDB statics)
        {
            var shipVars = PlayerProcessor.DesignBaseVars(hull, specialEquipment, statics).Get;

            shipVars[AComponentType.LevelKey] = reactor.Level;

            return(reactor.TypeInfo.Power.Evaluate(shipVars));
        }
Esempio n. 3
0
        private ReactorInfo bestReactor()
        {
            var hull    = new Component <HullType>(this.selectedHull.Type, this.selectedHull.Level);
            var reactor = ReactorType.MakeBest(
                playersTechLevels,
                hull,
                this.selectedSpecialEquipment,
                game.Statics
                );

            return(reactor != null ?
                   new ReactorInfo(reactor.TypeInfo, reactor.Level, PlayerProcessor.DesignBaseVars(hull, this.selectedSpecialEquipment, game.Statics).Get) :
                   null);
        }
Esempio n. 4
0
        public static Component <ReactorType> MakeBest(IDictionary <string, double> playersTechLevels, Component <HullType> hull, IEnumerable <Component <SpecialEquipmentType> > specialEquipment, StaticsDB statics)
        {
            var shipVars = PlayerProcessor.DesignBaseVars(hull, specialEquipment, statics).Get;

            return(Methods.FindBestOrDefault(
                       statics.Reactors.Values.Where(x => x.IsAvailable(playersTechLevels)).
                       Select(x => new Component <ReactorType>(x, x.HighestLevel(playersTechLevels))).
                       Where(x =>
            {
                shipVars[AComponentType.LevelKey] = x.Level;
                return x.TypeInfo.MinSize.Evaluate(shipVars) <= shipVars[HullType.ReactorSizeKey] && x.TypeInfo.CanPick;                         //TODO(v0.6) use final reactor size
            }),
                       x =>
            {
                shipVars[AComponentType.LevelKey] = x.Level;
                return x.TypeInfo.Power.Evaluate(shipVars);
            }
                       ));
        }