Upload from upload_mods.ps1
This commit is contained in:
18
Scripts/Attributes/ActionDataTargetAttribute.cs
Normal file
18
Scripts/Attributes/ActionDataTargetAttribute.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KFCommonUtilityLib.Scripts.Attributes
|
||||
{
|
||||
[System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
||||
public class ActionDataTargetAttribute : Attribute
|
||||
{
|
||||
public ActionDataTargetAttribute(Type DataType)
|
||||
{
|
||||
this.DataType = DataType;
|
||||
}
|
||||
public Type DataType { get; }
|
||||
}
|
||||
}
|
||||
45
Scripts/Attributes/MethodTargetAttribute.cs
Normal file
45
Scripts/Attributes/MethodTargetAttribute.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using HarmonyLib;
|
||||
|
||||
namespace KFCommonUtilityLib.Scripts.Attributes
|
||||
{
|
||||
public interface IMethodTarget
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MethodTargetPrefixAttribute : Attribute, IMethodTarget
|
||||
{
|
||||
public MethodTargetPrefixAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MethodTargetPostfixAttribute : Attribute, IMethodTarget
|
||||
{
|
||||
public MethodTargetPostfixAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class MethodTargetTranspilerAttribute : Attribute, IMethodTarget
|
||||
{
|
||||
public MethodTargetTranspilerAttribute()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static class IMethodTargetExtension
|
||||
{
|
||||
public static string GetTargetMethodIdentifier(this HarmonyMethod self)
|
||||
{
|
||||
return (self.methodName ?? "this[]") + (self.argumentTypes == null ? string.Empty : string.Join(",", Array.ConvertAll(self.argumentTypes, type => type.FullDescription())));
|
||||
}
|
||||
}
|
||||
}
|
||||
16
Scripts/Attributes/PatchTargetAttribute.cs
Normal file
16
Scripts/Attributes/PatchTargetAttribute.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace KFCommonUtilityLib.Scripts.Attributes
|
||||
{
|
||||
[System.AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
||||
public sealed class TypeTargetAttribute : Attribute
|
||||
{
|
||||
// This is a positional argument
|
||||
public TypeTargetAttribute(Type baseType)
|
||||
{
|
||||
BaseType = baseType;
|
||||
}
|
||||
|
||||
public Type BaseType { get; }
|
||||
}
|
||||
}
|
||||
14
Scripts/Attributes/TypeTargetExtensionAttribute.cs
Normal file
14
Scripts/Attributes/TypeTargetExtensionAttribute.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace KFCommonUtilityLib.Scripts.Attributes
|
||||
{
|
||||
[AttributeUsage(System.AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
||||
public class TypeTargetExtensionAttribute : Attribute
|
||||
{
|
||||
public Type ModuleType { get; }
|
||||
public TypeTargetExtensionAttribute(Type moduleType)
|
||||
{
|
||||
ModuleType = moduleType;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user