public void powerDrawPerSecond(IResourceSuppliable pm, double power_draw, double draw_power_consumption) { PowerConsumption powerConsumption; if (!power_consumption.TryGetValue(pm, out powerConsumption)) { powerConsumption = new PowerConsumption(); power_consumption.Add(pm, powerConsumption); } powerConsumption.Power_draw += power_draw; powerConsumption.Power_consume += draw_power_consumption; }
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; PowerConsumption powerConsumption; if (!power_consumption.TryGetValue(pm, out powerConsumption)) { powerConsumption = new PowerConsumption(); power_consumption.Add(pm, powerConsumption); } powerConsumption.Power_draw += power_draw_per_second; powerConsumption.Power_consume += power_cosumtion_per_second; }