2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
10using Microsoft.Xna.Framework;
15 public partial class CUI
17 public static Dictionary<string, int> Errors =
new();
18 public static void Error(
object msg,
int maxPrints = 1,
int tolerate = 5,
bool silent =
false)
21 if (!Errors.ContainsKey(s)) Errors[s] = 1;
22 else Errors[s] = Errors[s] + 1;
24 if (tolerate < Errors[s] && Errors[s] <= maxPrints)
Log($
"CUI: {s} x{Errors[s]}", Color.Orange);
In fact a static class managing static things.
static void Log(object msg, Color? color=null, [CallerFilePath] string source="", [CallerLineNumber] int lineNumber=0)
Prints a message to console.