Avoid unnecessary lookups in the production logic

by improving the GetBuildTime method and moving lookups around.
This commit is contained in:
abcdefg30
2016-01-21 16:18:14 +01:00
parent 6272d79072
commit 17daac11a1
3 changed files with 16 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
powerIcon.IsVisible = () => power != 0;
var lowpower = pm.PowerState != PowerState.Normal;
var time = palette.CurrentQueue == null ? 0 : palette.CurrentQueue.GetBuildTime(actor.Name)
var time = palette.CurrentQueue == null ? 0 : palette.CurrentQueue.GetBuildTime(actor)
* (lowpower ? palette.CurrentQueue.Info.LowPowerSlowdown : 1);
var timeString = WidgetUtils.FormatTime(time, world.Timestep);
timeLabel.GetText = () => timeString;