|
@@ -31,14 +31,28 @@ public abstract class World : DescriptionClass
|
|
|
if (sys == null) throw new Exception($"世界{GetType().Name}中不存在系统{typeof(T).Name}");
|
|
|
return sys;
|
|
|
}
|
|
|
-
|
|
|
+ static ConcurrentDictionary<World, WorkTimes> WorldsInfo = new ConcurrentDictionary<World, WorkTimes>();
|
|
|
protected virtual void FrameInfo(WorkTimes wt)
|
|
|
{
|
|
|
- if (wt.Total > Interval) Console.ForegroundColor = ConsoleColor.Red;
|
|
|
- Console.WriteLine(wt.GetInfo());
|
|
|
- Console.ResetColor();
|
|
|
+ WorldsInfo[this] = wt;
|
|
|
+ //if (wt.Total > Interval) Console.ForegroundColor = ConsoleColor.Red;
|
|
|
+ //Console.WriteLine(wt.GetInfo());
|
|
|
+ //Console.ResetColor();
|
|
|
}
|
|
|
+ static string LastInfo = "";
|
|
|
+ static void Print()
|
|
|
+ {
|
|
|
+ var info = "\n" + string.Join("\n", WorldsInfo.Values.Select(v => v.GetInfo().PadRight(200))).PadRight(1000);
|
|
|
|
|
|
+ if (info != LastInfo)
|
|
|
+ {
|
|
|
+ Console.CursorVisible = false;
|
|
|
+ Console.WriteLine(info);
|
|
|
+ Console.SetCursorPosition(0, 0);
|
|
|
+ LastInfo = info;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
public void Log<T>(T log) where T : ILog
|
|
|
{
|
|
|
var channel = Ltc.GetChannel();
|
|
@@ -140,6 +154,22 @@ public abstract class World : DescriptionClass
|
|
|
}
|
|
|
|
|
|
IsStart = true;
|
|
|
+
|
|
|
+ Task.Run(() =>
|
|
|
+ {
|
|
|
+
|
|
|
+ var i = 0;
|
|
|
+ while (IsStart)
|
|
|
+ {
|
|
|
+ i++;
|
|
|
+ if (i % 30 == 1)
|
|
|
+ {
|
|
|
+ Console.Clear();
|
|
|
+ }
|
|
|
+ Print();
|
|
|
+ Task.Delay(100).Wait();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public static void StopAll()
|