Supercell.GUT/Supercell.GUT.Titan/Logic/Debug/Debugger.cs
BreadDEV 8c6a533918 [v0.0.2] you can enter menu now. but still early state
todo: improve code and finish base structures
2024-03-05 17:37:18 +07:00

41 lines
817 B
C#

namespace Supercell.GUT.Titan.Logic.Debug;
public static class Debugger
{
private static IDebuggerListener? _listener;
public static void Print(string log)
{
_listener?.OnPrint(log);
}
public static void Warning(string log)
{
_listener?.OnWarning(log);
}
public static void Error(string log)
{
_listener?.OnError(log);
throw new LogicException(log);
}
public static void HudPrint(string log)
{
_listener?.OnHudPrint(log);
}
public static bool DoAssert(bool condition, string message)
{
if (!condition)
Error(message);
return condition;
}
public static void SetListener(IDebuggerListener listener)
{
_listener?.Detach();
_listener = listener;
}
}