using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Localization;
using UnityEngine.Localization.Components;
using UnityEngine.Localization.Settings;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("GameAssembly")]
[assembly: IgnoresAccessChecksTo("SharedAssembly")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Custom_Scoring")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("Custom_Scoring")]
[assembly: AssemblyTitle("Custom_Scoring")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace Microsoft.CodeAnalysis
{
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace Custom_Scoring
{
[BepInPlugin("Custom_Scoring", "Custom_Scoring", "0.1.0")]
public class Plugin : BaseUnityPlugin
{
public static bool Enabled = true;
public static int[]? OriginalScores = null;
public static int[] PlacementScores = new int[8] { 150, 120, 90, 70, 50, 40, 30, 20 };
public static int[] StrokeScores = new int[10] { 100, 90, 80, 70, 60, 50, 40, 30, 10, 0 };
public const string Id = "Custom_Scoring";
internal static ManualLogSource Log { get; private set; } = null;
public static string Name => "Custom_Scoring";
public static string Version => "0.1.0";
private void Awake()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
Log = ((BaseUnityPlugin)this).Logger;
new Harmony("Custom_Scoring").PatchAll();
SaveOriginalScores();
Log.LogInfo((object)("Plugin " + Name + " loaded!"));
}
private static void SaveOriginalScores()
{
try
{
object obj = (AccessTools.TypeByName("GameManager")?.GetProperty("MatchSettings", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy))?.GetValue(null);
if (obj != null && obj.GetType().GetField("<Scores>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(obj) is int[] array)
{
OriginalScores = (int[])array.Clone();
Log.LogInfo((object)("\ud83d\udcbe Scores originaux: " + string.Join(" | ", OriginalScores)));
}
}
catch (Exception ex)
{
ManualLogSource log = Log;
if (log != null)
{
log.LogError((object)("SaveOriginalScores: " + ex.Message));
}
}
}
public static void ApplyPlacement()
{
try
{
object obj = (AccessTools.TypeByName("GameManager")?.GetProperty("MatchSettings", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy))?.GetValue(null);
if (obj == null)
{
Log.LogError((object)"MatchSettings null !");
}
else
{
if (!(obj.GetType().GetField("<Scores>k__BackingField", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(obj) is int[] array))
{
return;
}
if (OriginalScores == null)
{
OriginalScores = (int[])array.Clone();
}
if (!Enabled)
{
for (int i = 0; i < Math.Min(OriginalScores.Length, array.Length); i++)
{
array[i] = OriginalScores[i];
}
Log.LogInfo((object)"\ud83d\udd34 Custom Scoring DÉSACTIVÉ → scores originaux restaurés");
}
else
{
for (int j = 0; j < Math.Min(PlacementScores.Length, array.Length); j++)
{
array[j] = PlacementScores[j];
}
Log.LogInfo((object)"\ud83d\udfe2 Custom Scoring ACTIVÉ");
}
}
}
catch (Exception ex)
{
Log.LogError((object)("ApplyPlacement: " + ex.Message));
}
}
public static int GetStrokePoints(int strokes)
{
if (!Enabled)
{
return 0;
}
if (strokes <= 0)
{
return 0;
}
int num = Math.Min(strokes - 1, StrokeScores.Length - 1);
return StrokeScores[num];
}
}
public static class Lang
{
public static bool IsFrench()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
try
{
Locale selectedLocale = LocalizationSettings.SelectedLocale;
if ((Object)(object)selectedLocale == (Object)null)
{
return false;
}
LocaleIdentifier identifier = selectedLocale.Identifier;
return ((LocaleIdentifier)(ref identifier)).Code.StartsWith("fr");
}
catch
{
return CultureInfo.CurrentUICulture.TwoLetterISOLanguageName == "fr";
}
}
public static string Get(string fr, string en)
{
if (!IsFrench())
{
return en;
}
return fr;
}
}
[HarmonyPatch]
public class InformPlayerScoredPatch
{
[HarmonyTargetMethod]
private static MethodBase TargetMethod()
{
return AccessTools.Method(AccessTools.TypeByName("CourseManager"), "InformPlayerScoredInternal", (Type[])null, (Type[])null);
}
[HarmonyPostfix]
private static void Postfix(object playerAsGolfer)
{
if (!Plugin.Enabled)
{
return;
}
try
{
if (!(bool)(AccessTools.TypeByName("NetworkServer")?.GetProperty("active", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) ?? ((object)false)))
{
return;
}
Type type = AccessTools.TypeByName("CourseManager");
object obj = (type.BaseType?.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy))?.GetValue(null);
if (obj == null)
{
return;
}
object obj2 = playerAsGolfer.GetType().GetProperty("connectionToClient", BindingFlags.Instance | BindingFlags.Public)?.GetValue(playerAsGolfer);
if (obj2 == null)
{
return;
}
MethodInfo method = obj.GetType().GetMethod("TryGetPlayerStateIndex", BindingFlags.Instance | BindingFlags.NonPublic);
object[] array = new object[2] { obj2, 0 };
if (method == null || !(bool)method.Invoke(obj, array))
{
return;
}
int num = (int)array[1];
object obj3 = obj.GetType().GetField("playerStates", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(obj);
if (obj3 == null)
{
return;
}
object obj4 = obj3.GetType().GetMethod("get_Item")?.Invoke(obj3, new object[1] { num });
if (obj4 == null)
{
return;
}
int num2 = (int)(obj4.GetType().GetField("matchStrokes", BindingFlags.Instance | BindingFlags.Public)?.GetValue(obj4) ?? ((object)0));
int strokePoints = Plugin.GetStrokePoints(num2);
if (strokePoints > 0)
{
FieldInfo field = obj4.GetType().GetField("courseScore", BindingFlags.Instance | BindingFlags.Public);
FieldInfo field2 = obj4.GetType().GetField("matchScore", BindingFlags.Instance | BindingFlags.Public);
int num3 = (int)(field?.GetValue(obj4) ?? ((object)0));
int num4 = (int)(field2?.GetValue(obj4) ?? ((object)0));
if (field != null)
{
field.SetValue(obj4, num3 + strokePoints);
}
if (field2 != null)
{
field2.SetValue(obj4, num4 + strokePoints);
}
Plugin.Log.LogInfo((object)$"\ud83c\udfcc\ufe0f {num2} coup(s) → +{strokePoints} pts (score: {num4} → {num4 + strokePoints})");
obj3.GetType().GetMethod("set_Item")?.Invoke(obj3, new object[2] { num, obj4 });
}
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("ScoredPatch: " + ex.Message));
}
}
}
[HarmonyPatch]
public class MatchSetupRulesInitPatch
{
[HarmonyTargetMethod]
private static MethodBase TargetMethod()
{
return AccessTools.Method(AccessTools.TypeByName("MatchSetupRules"), "Initialize", (Type[])null, (Type[])null);
}
[HarmonyPostfix]
private static void Postfix(object __instance)
{
try
{
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
object? obj = __instance.GetType().GetField("countdown", bindingAttr)?.GetValue(__instance);
Component val = (Component)((obj is Component) ? obj : null);
if ((Object)(object)val == (Object)null)
{
Plugin.Log.LogError((object)"countdown introuvable");
return;
}
Transform parent = val.transform.parent.parent.parent;
for (int i = 0; i < parent.childCount; i++)
{
if (((Object)parent.GetChild(i)).name == "Custom Scoring Header")
{
return;
}
}
GameObject gameObject = ((Component)val.transform.parent.GetChild(0)).gameObject;
object? obj2 = __instance.GetType().GetField("knockouts", bindingAttr)?.GetValue(__instance);
Component val2 = (Component)((obj2 is Component) ? obj2 : null);
Transform val3 = null;
Transform val4 = null;
for (int j = 0; j < parent.childCount; j++)
{
Transform child = parent.GetChild(j);
if (((Object)child).name == "Battle")
{
val3 = child;
}
if (((Object)child).name == "Battle Rules")
{
val4 = child;
}
}
if ((Object)(object)val3 == (Object)null || (Object)(object)val4 == (Object)null)
{
Plugin.Log.LogError((object)"Battle/Battle Rules introuvable !");
return;
}
GameObject val5 = Object.Instantiate<GameObject>(((Component)val3).gameObject, parent);
((Object)val5).name = "Custom Scoring Header";
LocalizeStringEvent[] componentsInChildren = val5.GetComponentsInChildren<LocalizeStringEvent>(true);
foreach (LocalizeStringEvent val6 in componentsInChildren)
{
Object.Destroy((Object)(object)val6);
}
TMP_Text componentInChildren = val5.GetComponentInChildren<TMP_Text>(true);
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.text = "Custom Scoring";
}
GameObject val7 = Object.Instantiate<GameObject>(((Component)val4).gameObject, parent);
((Object)val7).name = "Custom Scoring Rules";
for (int num = val7.transform.childCount - 1; num >= 0; num--)
{
Object.Destroy((Object)(object)((Component)val7.transform.GetChild(num)).gameObject);
}
CustomScoringUi.Build(gameObject, (val2 != null) ? val2.gameObject : null, val7.transform);
Plugin.ApplyPlacement();
Plugin.Log.LogInfo((object)"✓ Custom Scoring UI construite !");
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("InitPatch: " + ex.Message + "\n" + ex.StackTrace));
}
}
}
public static class CustomScoringUi
{
private static readonly string[] PlacementLabels = new string[8]
{
Lang.Get("1er", "1st"),
Lang.Get("2ème", "2nd"),
Lang.Get("3ème", "3rd"),
Lang.Get("4ème", "4th"),
Lang.Get("5ème", "5th"),
Lang.Get("6ème", "6th"),
Lang.Get("7ème", "7th"),
Lang.Get("8ème", "8th")
};
private static readonly string[] StrokeLabels = new string[10]
{
Lang.Get("1 coup", "1 stroke"),
Lang.Get("2 coups", "2 strokes"),
Lang.Get("3 coups", "3 strokes"),
Lang.Get("4 coups", "4 strokes"),
Lang.Get("5 coups", "5 strokes"),
Lang.Get("6 coups", "6 strokes"),
Lang.Get("7 coups", "7 strokes"),
Lang.Get("8 coups", "8 strokes"),
Lang.Get("9 coups", "9 strokes"),
Lang.Get("10+ coups", "10+ strokes")
};
public static void Build(GameObject sliderTemplate, GameObject? dropdownTemplate, Transform container)
{
try
{
if ((Object)(object)dropdownTemplate != (Object)null)
{
AddToggle(dropdownTemplate, container);
}
AddSectionTitle(sliderTemplate, container, Lang.Get("Rapidité", "Speed"));
for (int i = 0; i < 8; i++)
{
int idx2 = i;
AddSlider(sliderTemplate, container, PlacementLabels[i], Plugin.PlacementScores[i], 0, 300, 10, delegate(int v)
{
Plugin.PlacementScores[idx2] = v;
Plugin.ApplyPlacement();
});
}
AddSectionTitle(sliderTemplate, container, Lang.Get("Nombre de coups", "Stroke count"));
for (int j = 0; j < 10; j++)
{
int idx = j;
AddSlider(sliderTemplate, container, StrokeLabels[j], Plugin.StrokeScores[j], 0, 200, 10, delegate(int v)
{
Plugin.StrokeScores[idx] = v;
});
}
}
catch (Exception ex)
{
Plugin.Log.LogError((object)("Build: " + ex.Message + "\n" + ex.StackTrace));
}
}
private static void SetRowHeight(GameObject go)
{
LayoutElement val = go.GetComponent<LayoutElement>();
if ((Object)(object)val == (Object)null)
{
val = go.AddComponent<LayoutElement>();
}
val.minHeight = 40f;
val.preferredHeight = 40f;
}
private static void AddToggle(GameObject dropdownTemplate, Transform parent)
{
GameObject val = Object.Instantiate<GameObject>(dropdownTemplate, parent);
((Object)val).name = "CS_Toggle_Enabled";
SetRowHeight(val);
LocalizeStringEvent[] componentsInChildren = val.GetComponentsInChildren<LocalizeStringEvent>(true);
foreach (LocalizeStringEvent val2 in componentsInChildren)
{
Object.Destroy((Object)(object)val2);
}
TMP_Text[] componentsInChildren2 = val.GetComponentsInChildren<TMP_Text>(true);
if (componentsInChildren2.Length != 0)
{
componentsInChildren2[0].text = "Custom Scoring";
}
TMP_Dropdown componentInChildren = val.GetComponentInChildren<TMP_Dropdown>(true);
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.ClearOptions();
LocalizeStringEvent[] componentsInChildren3 = ((Component)componentInChildren).GetComponentsInChildren<LocalizeStringEvent>(true);
foreach (LocalizeStringEvent val3 in componentsInChildren3)
{
Object.Destroy((Object)(object)val3);
}
componentInChildren.AddOptions(new List<string>
{
Lang.Get("Oui", "Yes"),
Lang.Get("Non", "No")
});
((UnityEventBase)componentInChildren.onValueChanged).RemoveAllListeners();
componentInChildren.SetValueWithoutNotify((!Plugin.Enabled) ? 1 : 0);
((UnityEvent<int>)(object)componentInChildren.onValueChanged).AddListener((UnityAction<int>)delegate(int v)
{
Plugin.Enabled = v == 0;
Plugin.Log.LogInfo((object)("\ud83d\udd18 Custom Scoring " + (Plugin.Enabled ? "ACTIVÉ \ud83d\udfe2" : "DÉSACTIVÉ \ud83d\udd34")));
Plugin.ApplyPlacement();
});
}
else
{
Plugin.Log.LogWarning((object)"Pas de TMP_Dropdown pour le toggle !");
}
}
private static void AddSectionTitle(GameObject template, Transform parent, string title)
{
GameObject val = Object.Instantiate<GameObject>(template, parent);
((Object)val).name = "CS_Title_" + title;
SetRowHeight(val);
LocalizeStringEvent[] componentsInChildren = val.GetComponentsInChildren<LocalizeStringEvent>(true);
foreach (LocalizeStringEvent val2 in componentsInChildren)
{
Object.Destroy((Object)(object)val2);
}
Slider componentInChildren = val.GetComponentInChildren<Slider>(true);
if ((Object)(object)componentInChildren != (Object)null)
{
((Component)((Component)componentInChildren).transform.parent).gameObject.SetActive(false);
}
TMP_Text[] componentsInChildren2 = val.GetComponentsInChildren<TMP_Text>(true);
if (componentsInChildren2.Length != 0)
{
componentsInChildren2[0].text = title;
componentsInChildren2[0].fontStyle = (FontStyles)1;
}
if (componentsInChildren2.Length > 1)
{
componentsInChildren2[1].text = "";
}
}
private static void AddSlider(GameObject template, Transform parent, string label, int defaultVal, int min, int max, int step, Action<int> onChange)
{
Action<int> onChange2 = onChange;
GameObject val = Object.Instantiate<GameObject>(template, parent);
((Object)val).name = "CS_Slider_" + label;
SetRowHeight(val);
LocalizeStringEvent[] componentsInChildren = val.GetComponentsInChildren<LocalizeStringEvent>(true);
foreach (LocalizeStringEvent val2 in componentsInChildren)
{
Object.Destroy((Object)(object)val2);
}
Slider slider = val.GetComponentInChildren<Slider>(true);
if ((Object)(object)slider == (Object)null)
{
Plugin.Log.LogError((object)("Pas de Slider pour '" + label + "'"));
return;
}
slider.minValue = min;
slider.maxValue = max;
slider.wholeNumbers = true;
((UnityEventBase)slider.onValueChanged).RemoveAllListeners();
slider.SetValueWithoutNotify((float)defaultVal);
TMP_Text[] componentsInChildren2 = val.GetComponentsInChildren<TMP_Text>(true);
TMP_Text val3 = ((componentsInChildren2.Length != 0) ? componentsInChildren2[0] : null);
TMP_Text valueText = ((componentsInChildren2.Length > 1) ? componentsInChildren2[1] : null);
if ((Object)(object)val3 != (Object)null)
{
val3.text = label;
}
if ((Object)(object)valueText != (Object)null)
{
valueText.text = defaultVal.ToString();
}
((UnityEvent<float>)(object)slider.onValueChanged).AddListener((UnityAction<float>)delegate(float v)
{
int num = Mathf.RoundToInt(v / (float)step) * step;
num = Mathf.Clamp(num, min, max);
if (Math.Abs(slider.value - (float)num) > 0.01f)
{
slider.SetValueWithoutNotify((float)num);
}
if ((Object)(object)valueText != (Object)null)
{
valueText.text = num.ToString();
}
onChange2(num);
});
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ConstantExpectedAttribute : Attribute
{
public object? Min { get; set; }
public object? Max { get; set; }
}
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ExperimentalAttribute : Attribute
{
public string DiagnosticId { get; }
public string? UrlFormat { get; set; }
public ExperimentalAttribute(string diagnosticId)
{
DiagnosticId = diagnosticId;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SetsRequiredMembersAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class StringSyntaxAttribute : Attribute
{
public const string CompositeFormat = "CompositeFormat";
public const string DateOnlyFormat = "DateOnlyFormat";
public const string DateTimeFormat = "DateTimeFormat";
public const string EnumFormat = "EnumFormat";
public const string GuidFormat = "GuidFormat";
public const string Json = "Json";
public const string NumericFormat = "NumericFormat";
public const string Regex = "Regex";
public const string TimeOnlyFormat = "TimeOnlyFormat";
public const string TimeSpanFormat = "TimeSpanFormat";
public const string Uri = "Uri";
public const string Xml = "Xml";
public string Syntax { get; }
public object?[] Arguments { get; }
public StringSyntaxAttribute(string syntax)
{
Syntax = syntax;
Arguments = new object[0];
}
public StringSyntaxAttribute(string syntax, params object?[] arguments)
{
Syntax = syntax;
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class UnscopedRefAttribute : Attribute
{
}
}
namespace System.Runtime.Versioning
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresPreviewFeaturesAttribute : Attribute
{
public string? Message { get; }
public string? Url { get; set; }
public RequiresPreviewFeaturesAttribute()
{
}
public RequiresPreviewFeaturesAttribute(string? message)
{
Message = message;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CallerArgumentExpressionAttribute : Attribute
{
public string ParameterName { get; }
public CallerArgumentExpressionAttribute(string parameterName)
{
ParameterName = parameterName;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CollectionBuilderAttribute : Attribute
{
public Type BuilderType { get; }
public string MethodName { get; }
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}
}
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class CompilerFeatureRequiredAttribute : Attribute
{
public const string RefStructs = "RefStructs";
public const string RequiredMembers = "RequiredMembers";
public string FeatureName { get; }
public bool IsOptional { get; set; }
public CompilerFeatureRequiredAttribute(string featureName)
{
FeatureName = featureName;
}
}
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
{
public string[] Arguments { get; }
public InterpolatedStringHandlerArgumentAttribute(string argument)
{
Arguments = new string[1] { argument };
}
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
{
Arguments = arguments;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class InterpolatedStringHandlerAttribute : Attribute
{
}
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal static class IsExternalInit
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class ModuleInitializerAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class OverloadResolutionPriorityAttribute : Attribute
{
public int Priority { get; }
public OverloadResolutionPriorityAttribute(int priority)
{
Priority = priority;
}
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = true, AllowMultiple = false)]
[ExcludeFromCodeCoverage]
internal sealed class ParamCollectionAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class RequiredMemberAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[ExcludeFromCodeCoverage]
internal sealed class RequiresLocationAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event | AttributeTargets.Interface, Inherited = false)]
[ExcludeFromCodeCoverage]
internal sealed class SkipLocalsInitAttribute : Attribute
{
}
}