예제 #1
0
        public void powerDrawPerSecond(IResourceSuppliable pm, double power_draw, double draw_power_consumption)
        {
            PowerDistribution powerDistribution;

            if (!power_consumption.TryGetValue(pm, out powerDistribution))
            {
                powerDistribution = new PowerDistribution();
                power_consumption.Add(pm, powerDistribution);
            }
            powerDistribution.Power_draw    += power_draw;
            powerDistribution.Power_consume += draw_power_consumption;
        }
예제 #2
0
        public void powerDrawFixed(IResourceSuppliable pm, double power_draw, double power_cosumtion)
        {
            var timeWarpFixedDeltaTime     = TimeWarpFixedDeltaTime;
            var power_draw_per_second      = power_draw / timeWarpFixedDeltaTime;
            var power_cosumtion_per_second = power_cosumtion / timeWarpFixedDeltaTime;

            PowerDistribution powerDistribution;

            if (!power_consumption.TryGetValue(pm, out powerDistribution))
            {
                powerDistribution = new PowerDistribution();
                power_consumption.Add(pm, powerDistribution);
            }
            powerDistribution.Power_draw    += power_draw_per_second;
            powerDistribution.Power_consume += power_cosumtion_per_second;
        }