예제 #1
0
        public void CalculateSpending(MainGame game, PlayerProcessor playerProcessor)
        {
            var vars = this.LocalEffects(game.Statics).UnionWith(playerProcessor.TechLevels).Get;
            ColonyFormulaSet formulas = game.Statics.ColonyFormulas;
            var orders = game.Orders[this.Colony.Owner];

            double industryPotential =
                (1 - playerProcessor.MaintenanceRatio) *
                this.BuilderEfficiency *
                this.WorkingPopulation;
            double industryPoints =
                orders.ConstructionPlans[this.Colony].SpendingRatio *
                industryPotential;

            this.SpendingPlan = SimulateSpending(
                Colony,
                industryPoints,
                orders.ConstructionPlans[this.Colony].Queue,
                vars
                );
            this.Production = this.SpendingPlan.Sum(x => x.InvestedPoints);

            this.SpendingRatioEffective = (industryPotential > 0) ?
                                          this.Production / industryPotential :
                                          0;
        }
예제 #2
0
        public void CalculateSpending(StaticsDB statics, PlayerProcessor playerProcessor)
        {
            var vars = this.LocalEffects(statics).UnionWith(playerProcessor.TechLevels).Get;
            ColonyFormulaSet formulas = statics.ColonyFormulas;

            double industryPotential = this.WorkingPopulation * this.BuilderEfficiency;
            double industryPoints    =
                Colony.Owner.Orders.ConstructionPlans[Colony].SpendingRatio *
                industryPotential;

            this.SpendingPlan = SimulateSpending(
                Colony,
                industryPoints,
                Colony.Owner.Orders.ConstructionPlans[Colony].Queue,
                vars
                );
            this.Production = this.SpendingPlan.Sum(x => x.InvestedPoints);

            this.SpendingRatioEffective = (industryPotential > 0) ?
                                          this.Production / industryPotential :
                                          0;
        }