eradicate 'delegate' misuse

This commit is contained in:
Chris Forbes
2011-05-22 21:58:39 +12:00
parent 4b12a19af0
commit ef03d46f13
72 changed files with 234 additions and 269 deletions

View File

@@ -0,0 +1,33 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Support;
using OpenRA.Widgets;
namespace OpenRA.Mods.Cnc.Widgets.Logic
{
public class CncPerfDebugLogic
{
[ObjectCreator.UseCtor]
public CncPerfDebugLogic([ObjectCreator.Param] Widget widget)
{
// Performance info
var perfRoot = widget.GetWidget("PERFORMANCE_INFO");
perfRoot.GetWidget("PERF_GRAPH").IsVisible = () => Game.Settings.Debug.PerfGraph;
var text = perfRoot.GetWidget<LabelWidget>("PERF_TEXT");
text.IsVisible = () => Game.Settings.Debug.PerfText;
text.GetText = () =>
"Tick {0} @ {1:F1} ms\nRender {2} @ {3:F1} ms\nBatches: {4}".F(
Game.LocalTick, PerfHistory.items["tick_time"].Average(Game.Settings.Debug.Samples),
Game.RenderFrame, PerfHistory.items["render"].Average(Game.Settings.Debug.Samples),
PerfHistory.items["batches"].LastValue);
}
}
}