2021-10-15 20:06:51 +00:00
|
|
|
|
using QSB.Utility;
|
2021-06-19 12:55:04 +00:00
|
|
|
|
using System.Linq;
|
2021-06-18 20:54:32 +00:00
|
|
|
|
|
|
|
|
|
namespace QSB.Patches
|
2020-11-03 21:11:10 +00:00
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public abstract class QSBPatch
|
|
|
|
|
{
|
|
|
|
|
public abstract QSBPatchTypes Type { get; }
|
2021-06-18 20:54:32 +00:00
|
|
|
|
|
2021-10-15 20:06:51 +00:00
|
|
|
|
public virtual void DoPatches()
|
2021-06-18 20:54:32 +00:00
|
|
|
|
{
|
2021-10-15 20:06:51 +00:00
|
|
|
|
var oldMethods = QSBPatchManager.HarmonyInstance.GetPatchedMethods();
|
|
|
|
|
QSBPatchManager.HarmonyInstance.PatchAll(GetType());
|
|
|
|
|
foreach (var method in QSBPatchManager.HarmonyInstance.GetPatchedMethods().Except(oldMethods))
|
2021-06-18 20:54:32 +00:00
|
|
|
|
{
|
2021-10-15 20:06:51 +00:00
|
|
|
|
DebugLog.DebugWrite($"- Patching {method.DeclaringType}.{method.Name}");
|
2021-06-18 20:54:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-15 20:06:51 +00:00
|
|
|
|
public void DoUnpatches()
|
2021-06-19 12:55:04 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|