Added FisheryLib.Collections.FishTable and Mono.Cecil extension methods

A bit of refactoring has been done too
This commit is contained in:
bbradson
2023-06-03 20:10:58 +02:00
parent 8fa92f15a6
commit cdf209eb02
72 changed files with 8145 additions and 2098 deletions
+12 -10
View File
@@ -3,22 +3,24 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using JetBrains.Annotations;
namespace FisheryLib;
[PublicAPI]
public static class Log
{
public static void Message(string message) => _message(message);
public static void Warning(string message) => _warning(message);
public static void Error(string message) => _error(message);
public static void Message(string message) => Config.Message(message);
public static void Warning(string message) => Config.Warning(message);
public static void Error(string message) => Config.Error(message);
[PublicAPI]
public static class Config
{
public static Action<string> Message { set => _message = value; }
public static Action<string> Warning { set => _warning = value; }
public static Action<string> Error { set => _error = value; }
}
public static Action<string> Message { get; set; } = static text => Verse.Log.Message(text);
private static Action<string> _message = Verse.Log.Message;
private static Action<string> _warning = Verse.Log.Warning;
private static Action<string> _error = Verse.Log.Error;
public static Action<string> Warning { get; set; } = static text => Verse.Log.Warning(text);
public static Action<string> Error { get; set; } = static text => Verse.Log.Error(text);
}
}