move all the Game.Exts junk either down into FileFormats or into WorldUtils

This commit is contained in:
Chris Forbes
2011-03-12 19:33:16 +13:00
parent f4494d67b2
commit 1e3f365cf2
6 changed files with 55 additions and 78 deletions

View File

@@ -137,6 +137,20 @@ namespace OpenRA
o.Subject, o.Subject.Owner.Country.Race))
return;
}
}
}
public static void DoTimed<T>(this IEnumerable<T> e, Action<T> a, string text, double time)
{
var sw = new Stopwatch();
e.Do(x =>
{
var t = sw.ElapsedTime();
a(x);
var dt = sw.ElapsedTime() - t;
if (dt > time)
Log.Write("perf", text, x, dt * 1000, Game.LocalTick);
});
}
}
}