public void Update() { foreach (var entry in SAMLog.Entries.Reverse().TakeWhile(p => p != _lastReadEntry).Reverse()) { _lines.Add(CreateLine(entry)); _lastReadEntry = entry; DebugSettings.SetManual("DebugTextDisplay", true); } while (_lines.Count(l => l.IsAlive) > MAX_LINE_COUNT) { var d = _lines.Where(l => l.IsAlive && l.Lifetime < 60).OrderBy(l => l.Lifetime).FirstOrDefault(); if (d == null) { break; } d.IsAlive = false; } }
public DebugTextDisplayLine AddTabularLine(string debugSettingsKey, Func <List <string> > texts) { return(AddLine(new DebugTextDisplayLine(texts, () => DebugSettings.Get(debugSettingsKey)))); }
public DebugTextDisplayLine AddLine(string debugSettingsKey, Func <string> text) { return(AddLine(new DebugTextDisplayLine(text, () => DebugSettings.Get(debugSettingsKey)))); }