mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-15 01:34:38 +00:00
41 lines
814 B
C#
41 lines
814 B
C#
|
namespace Supercell.GUT.Titan.Debugging;
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|