First commit

This commit is contained in:
sbularca
2026-05-19 15:52:04 +02:00
commit 27b7aeee46
1660 changed files with 240354 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using System.Runtime.CompilerServices;
namespace Jovian.InGameLogging {
public readonly struct InGameLogger {
private readonly IGameLogStore store;
private readonly LogChannel channel;
public InGameLogger(IGameLogStore store, LogChannel channel) {
this.store = store;
this.channel = channel;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Log(string message) {
store.Add(channel, message);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Log(string message, string hexColor) {
var prefix = hexColor.Length > 0 && hexColor[0] == '#' ? "" : "#";
store.Add(channel, $"<color={prefix}{hexColor}>{message}</color>");
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Enable() {
store.EnableChannel(channel);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Disable() {
store.DisableChannel(channel);
}
public bool IsEnabled => store.IsChannelEnabled(channel);
}
}