Decompiled source of Terrainer v1.0.0

plugins/Terrainer.dll

Decompiled 6 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using ExampleCallMethodMod.Utils;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("assembly_googleanalytics")]
[assembly: IgnoresAccessChecksTo("assembly_guiutils")]
[assembly: IgnoresAccessChecksTo("assembly_lux")]
[assembly: IgnoresAccessChecksTo("assembly_postprocessing")]
[assembly: IgnoresAccessChecksTo("assembly_simplemeshcombine")]
[assembly: IgnoresAccessChecksTo("assembly_sunshafts")]
[assembly: IgnoresAccessChecksTo("assembly_utils")]
[assembly: IgnoresAccessChecksTo("assembly_valheim")]
[assembly: IgnoresAccessChecksTo("gui_framework")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("Terrainer")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Terrainer")]
[assembly: AssemblyTitle("Terrainer")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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]
	[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]
	[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 ExampleCallMethodMod
{
	[BepInPlugin("com.github.terrainer.Terrainer", "Terrainer", "1.0.0.0")]
	public class Mod : BaseUnityPlugin
	{
		private static readonly Harmony harmony = new Harmony("com.github.terrainer.Terrainer");

		public const string LevelPieceName = "Terrainer_LevelToHeight";

		public const string PluginAuthor = "Terrainer";

		public const string PluginGuid = "com.github.terrainer.Terrainer";

		public const string PluginName = "Terrainer";

		public const string PluginVersion = "1.0.0.0";

		public static ConfigEntry<float> LevelRadius { get; private set; }

		public static ConfigEntry<float> HeightStep { get; private set; }

		public static ConfigEntry<float> HeightStepLarge { get; private set; }

		public static float TargetHeight { get; set; }

		public static bool HasTargetHeight { get; set; }

		private void Awake()
		{
			LevelRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Leveler", "Radius", 4f, "Радиус выравнивания у нового режима мотыги.");
			HeightStep = ((BaseUnityPlugin)this).Config.Bind<float>("Leveler", "HeightStep", 0.25f, "Шаг изменения высоты колесиком мыши.");
			HeightStepLarge = ((BaseUnityPlugin)this).Config.Bind<float>("Leveler", "HeightStepLarge", 2f, "Шаг изменения высоты при зажатом Ctrl.");
			harmony.PatchAll();
		}

		private void OnDestroy()
		{
			harmony.UnpatchSelf();
		}

		private void OnGUI()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			if (HasTargetHeight && !((Object)(object)Player.m_localPlayer == (Object)null))
			{
				string text = $"Высота: {TargetHeight:F2}  (колесо — изменить, R — сброс)";
				Rect val = default(Rect);
				((Rect)(ref val))..ctor((float)Screen.width / 2f + 24f, (float)Screen.height / 2f - 8f, 420f, 24f);
				Rect val2 = val;
				GUIStyle val3 = new GUIStyle(GUI.skin.label)
				{
					fontSize = 15
				};
				val3.normal.textColor = Color.white;
				GUI.Label(val2, text, val3);
			}
		}
	}
	public static class PlayerPatch
	{
		private const float ScrollThreshold = 0.05f;

		private static float scrollAccumulator;

		private static bool IsActiveMode(Player player)
		{
			return (Object)(object)player == (Object)(object)Player.m_localPlayer && ((Character)player).InPlaceMode() && (Object)(object)player.m_placementGhost != (Object)null && ((Object)player.m_placementGhost).name == "Terrainer_LevelToHeight";
		}

		[HarmonyPatch(typeof(Player), "UpdatePlacementGhost")]
		[HarmonyPostfix]
		private static void PlaceGhostAtTargetHeight(Player __instance)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (IsActiveMode(__instance))
			{
				Transform transform = __instance.m_placementGhost.transform;
				if (!Mod.HasTargetHeight)
				{
					Mod.TargetHeight = transform.position.y;
					Mod.HasTargetHeight = true;
				}
				transform.position = new Vector3(transform.position.x, Mod.TargetHeight, transform.position.z);
			}
		}

		[HarmonyPatch(typeof(Player), "Update")]
		[HarmonyPostfix]
		private static void HandleHeightInput(Player __instance)
		{
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			if (!Mod.HasTargetHeight && !IsActiveMode(__instance))
			{
				return;
			}
			if (!IsActiveMode(__instance) || Hud.IsPieceSelectionVisible())
			{
				scrollAccumulator = 0f;
				if (!IsActiveMode(__instance))
				{
					Mod.HasTargetHeight = false;
				}
				return;
			}
			scrollAccumulator += ZInput.GetMouseScrollWheel();
			float num = ((ZInput.GetKey((KeyCode)306, true) || ZInput.GetKey((KeyCode)305, true)) ? Mod.HeightStepLarge.Value : Mod.HeightStep.Value);
			while (scrollAccumulator >= 0.05f)
			{
				scrollAccumulator -= 0.05f;
				Mod.TargetHeight += num;
			}
			while (scrollAccumulator <= -0.05f)
			{
				scrollAccumulator += 0.05f;
				Mod.TargetHeight -= num;
			}
			if (ZInput.GetButtonDown("Rotate"))
			{
				Mod.TargetHeight = ZoneSystem.instance.GetGroundHeight(((Component)Player.m_localPlayer).transform.position);
			}
		}
	}
	[HarmonyPatch(typeof(ZNetScene), "Awake")]
	public static class ZNetScenePatch
	{
		private static void Postfix(ZNetScene __instance)
		{
			GameObject itemPrefab = ObjectDB.instance.GetItemPrefab("Hoe");
			PieceTable val = ((itemPrefab == null) ? null : itemPrefab.GetComponent<ItemDrop>()?.m_itemData.m_shared.m_buildPieces);
			if ((Object)(object)val == (Object)null || (Object)(object)__instance == (Object)null)
			{
				return;
			}
			GameObject val2 = null;
			foreach (GameObject piece in val.m_pieces)
			{
				TerrainModifier val3 = ((piece != null) ? piece.GetComponent<TerrainModifier>() : null);
				if ((Object)(object)val3 != (Object)null && val3.m_level)
				{
					val2 = piece;
					break;
				}
			}
			if ((Object)(object)val2 == (Object)null)
			{
				Debug.LogWarning((object)"[Terrainer] Не найден ванильный пьес выравнивания мотыги, режим не добавлен");
				return;
			}
			GameObject val4 = Object.Instantiate<GameObject>(val2, ((Component)__instance).transform);
			((Object)val4).name = "Terrainer_LevelToHeight";
			val4.SetActive(false);
			TerrainModifier component = val4.GetComponent<TerrainModifier>();
			component.m_levelRadius = Mod.LevelRadius.Value;
			component.m_paintRadius = Mathf.Max(component.m_paintRadius, Mod.LevelRadius.Value);
			Piece component2 = val4.GetComponent<Piece>();
			component2.m_name = "Выровнять по высоте";
			component2.m_description = "Колесо мыши выбирает высоту, ЛКМ выравнивает terrain в области до неё.";
			if (!__instance.m_prefabs.Contains(val4))
			{
				__instance.m_prefabs.Add(val4);
			}
			if (!val.m_pieces.Contains(val4))
			{
				val.m_pieces.Add(val4);
			}
			Debug.Log((object)"[Terrainer] Режим 'Выровнять по высоте' добавлен в таблицу мотыги");
		}
	}
}
namespace ExampleCallMethodMod.Utils
{
	public static class ArrayUtils
	{
		public const string NullString = "<null>";

		public static IEnumerable<object> ToArray(object obj)
		{
			if (!(obj is IEnumerable source))
			{
				if (obj == null)
				{
					return Enumerable.Empty<object>();
				}
				return new object[1] { obj };
			}
			return source.Cast<object>();
		}

		public static IEnumerable<string> ToStringArray(object obj)
		{
			return from o in ToArray(obj)
				select o?.ToString() ?? "<null>";
		}
	}
	public static class CommandParser
	{
		public enum SegmentType
		{
			Unknown,
			Int,
			Float,
			String,
			Identifier
		}

		public class CommandSegment
		{
			public SegmentType Type { get; }

			public string Text { get; }

			public CommandSegment(SegmentType type, string text)
			{
				Type = type;
				Text = text ?? "";
			}

			public override string ToString()
			{
				return Text;
			}
		}

		public class TakerResult
		{
			public CommandSegment Segment { get; }

			public int Offset { get; }

			public TakerResult(CommandSegment segment)
			{
				Segment = segment;
				Offset = segment?.Text.Length ?? 0;
			}

			public TakerResult(CommandSegment segment, int offset)
				: this(segment)
			{
				Segment = segment;
				Offset = offset;
			}
		}

		private static readonly Func<string, int, TakerResult>[] segmentTakers = new Func<string, int, TakerResult>[4] { TakeInt, TakeFloat, TakeString, TakeIdentifier };

		public static IEnumerable<CommandSegment> Parse(string input)
		{
			if (string.IsNullOrWhiteSpace(input))
			{
				yield break;
			}
			int index = 0;
			while (true)
			{
				TakerResult takerResult2;
				TakerResult takerResult = (takerResult2 = TakeSegment(input, index));
				if (takerResult2 != null)
				{
					yield return takerResult.Segment;
					index = takerResult.Offset;
					continue;
				}
				break;
			}
		}

		private static TakerResult TakeSegment(string input, int offset, SegmentType type = SegmentType.Unknown)
		{
			while (true)
			{
				if (offset >= input.Length)
				{
					return null;
				}
				if (input[offset] != ' ')
				{
					break;
				}
				offset++;
			}
			int startIndex = offset;
			TakerResult takerResult = null;
			Func<string, int, TakerResult>[] array = segmentTakers;
			foreach (Func<string, int, TakerResult> func in array)
			{
				takerResult = func(input, offset);
				if (takerResult?.Segment != null)
				{
					break;
				}
			}
			return takerResult ?? new TakerResult(new CommandSegment(SegmentType.Unknown, input.Substring(startIndex)));
		}

		private static TakerResult TakeIdentifier(string input, int offset)
		{
			Match match = Regex.Match(input.Substring(offset), "^\\w+");
			CommandSegment commandSegment = (match.Success ? new CommandSegment(SegmentType.Identifier, match.Value) : null);
			return new TakerResult(commandSegment, (offset + commandSegment?.Text.Length) ?? offset);
		}

		private static TakerResult TakeInt(string input, int offset)
		{
			Match match = Regex.Match(input.Substring(offset), "^\\-?\\d+");
			CommandSegment commandSegment = (match.Success ? new CommandSegment(SegmentType.Int, match.Value) : null);
			return new TakerResult(commandSegment, (offset + commandSegment?.Text.Length) ?? offset);
		}

		private static TakerResult TakeFloat(string input, int offset)
		{
			Match match = Regex.Match(input.Substring(offset), "^\\-?\\d+(?:\\.\\d+)?");
			CommandSegment commandSegment = (match.Success ? new CommandSegment(SegmentType.Float, match.Value) : null);
			return new TakerResult(commandSegment, (offset + commandSegment?.Text.Length) ?? offset);
		}

		private static TakerResult TakeString(string input, int offset)
		{
			if (input[offset] != '"')
			{
				return null;
			}
			StringBuilder stringBuilder = new StringBuilder();
			offset++;
			while (offset < input.Length)
			{
				if (input[offset] == '\\' && offset + 1 < input.Length)
				{
					stringBuilder.Append(input[offset + 1]);
					offset += 2;
					continue;
				}
				if (input[offset] == '"')
				{
					offset++;
					break;
				}
				stringBuilder.Append(input[offset]);
				offset++;
			}
			return new TakerResult(new CommandSegment(SegmentType.String, stringBuilder.ToString()), offset);
		}
	}
}
namespace ExampleCallMethodMod.Patches
{
	public static class ConsolePatch
	{
		[HarmonyPatch(typeof(Console), "IsConsoleEnabled")]
		public static class ConsoleEnabled
		{
			public static bool Prefix(ref bool __result)
			{
				__result = true;
				return false;
			}
		}

		[HarmonyPatch(typeof(Terminal), "InputText")]
		public static class InputText
		{
			public static bool Prefix()
			{
				Console instance = Console.instance;
				string text = ((TMP_InputField)((Terminal)instance).m_input).text;
				if (!text.StartsWith("call", ignoreCase: true, CultureInfo.InvariantCulture))
				{
					return true;
				}
				CommandParser.CommandSegment[] parts = CommandParser.Parse(text).ToArray();
				if (parts.Length < 3)
				{
					((Terminal)instance).AddString("call command requires at least 3 arguments: call <class> <methodName> [arg1] [arg2]");
					return false;
				}
				((Terminal)instance).AddString(text);
				Type type = typeof(Console).Assembly.GetTypes().FirstOrDefault((Type t) => t.Name.Equals(parts[1].Text, StringComparison.InvariantCultureIgnoreCase));
				if (type == null)
				{
					((Terminal)instance).AddString($"Could not find class with name '{parts[1]}'");
					return false;
				}
				MethodInfo methodInfo = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.InvokeMethod).FirstOrDefault((MethodInfo m) => m.Name.Equals(parts[2].Text, StringComparison.InvariantCultureIgnoreCase));
				if (methodInfo == null)
				{
					((Terminal)instance).AddString("Could not find method '" + parts[2].Text + "' on class '" + type.FullName + "'");
					return false;
				}
				ParameterInfo[] parameters = methodInfo.GetParameters();
				if (parameters.Length != parts.Length - 3)
				{
					((Terminal)instance).AddString("Command does not match method parameters. Expected parameter types: " + string.Join(", ", parameters.Select((ParameterInfo p) => p.ParameterType.Name)));
					return false;
				}
				object[] array = new object[parameters.Length];
				for (int num = 0; num < parameters.Length; num++)
				{
					string text2 = parts[num + 3].Text;
					Type parameterType = parameters[num].ParameterType;
					try
					{
						array[num] = TypeDescriptor.GetConverter(parameterType).ConvertFrom(text2);
					}
					catch (NotSupportedException)
					{
						((Terminal)instance).AddString($"Cannot convert argument {num + 1} '{text2}' to type of '{parameterType.FullName}'");
						return false;
					}
				}
				object obj = null;
				if (!methodInfo.IsStatic)
				{
					obj = ((type == typeof(Player)) ? Player.m_localPlayer : type.GetField("m_instance", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null));
					if (obj == null)
					{
						((Terminal)instance).AddString("Could not call method '" + methodInfo.Name + "' because it's an instance method and no static instance field is defined on it");
						return false;
					}
				}
				object obj2 = methodInfo.Invoke(obj, array);
				if (obj2 != null)
				{
					((Terminal)instance).AddString(string.Join(", ", ArrayUtils.ToStringArray(obj2)));
				}
				return false;
			}
		}
	}
}
namespace System
{
	[ExcludeFromCodeCoverage]
	internal readonly struct Index : IEquatable<Index>
	{
		private static class ThrowHelper
		{
			[DoesNotReturn]
			public static void ThrowValueArgumentOutOfRange_NeedNonNegNumException()
			{
				throw new ArgumentOutOfRangeException("value", "Non-negative number required.");
			}
		}

		private readonly int _value;

		public static Index Start => new Index(0);

		public static Index End => new Index(-1);

		public int Value
		{
			get
			{
				if (_value < 0)
				{
					return ~_value;
				}
				return _value;
			}
		}

		public bool IsFromEnd => _value < 0;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Index(int value, bool fromEnd = false)
		{
			if (value < 0)
			{
				ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException();
			}
			if (fromEnd)
			{
				_value = ~value;
			}
			else
			{
				_value = value;
			}
		}

		private Index(int value)
		{
			_value = value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Index FromStart(int value)
		{
			if (value < 0)
			{
				ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException();
			}
			return new Index(value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Index FromEnd(int value)
		{
			if (value < 0)
			{
				ThrowHelper.ThrowValueArgumentOutOfRange_NeedNonNegNumException();
			}
			return new Index(~value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public int GetOffset(int length)
		{
			int num = _value;
			if (IsFromEnd)
			{
				num += length + 1;
			}
			return num;
		}

		public override bool Equals([NotNullWhen(true)] object? value)
		{
			return value is Index && _value == ((Index)value)._value;
		}

		public bool Equals(Index other)
		{
			return _value == other._value;
		}

		public override int GetHashCode()
		{
			return _value;
		}

		public static implicit operator Index(int value)
		{
			return FromStart(value);
		}

		public override string ToString()
		{
			if (IsFromEnd)
			{
				return ToStringFromEnd();
			}
			return ((uint)Value).ToString();
		}

		private string ToStringFromEnd()
		{
			return "^" + Value;
		}
	}
	[ExcludeFromCodeCoverage]
	internal readonly struct Range : IEquatable<Range>
	{
		private static class HashHelpers
		{
			public static int Combine(int h1, int h2)
			{
				uint num = (uint)((h1 << 5) | (h1 >>> 27));
				return ((int)num + h1) ^ h2;
			}
		}

		private static class ThrowHelper
		{
			[DoesNotReturn]
			public static void ThrowArgumentOutOfRangeException()
			{
				throw new ArgumentOutOfRangeException("length");
			}
		}

		public Index Start { get; }

		public Index End { get; }

		public static Range All => Index.Start..Index.End;

		public Range(Index start, Index end)
		{
			Start = start;
			End = end;
		}

		public override bool Equals([NotNullWhen(true)] object? value)
		{
			return value is Range { Start: var start } range && start.Equals(Start) && range.End.Equals(End);
		}

		public bool Equals(Range other)
		{
			return other.Start.Equals(Start) && other.End.Equals(End);
		}

		public override int GetHashCode()
		{
			return HashHelpers.Combine(Start.GetHashCode(), End.GetHashCode());
		}

		public override string ToString()
		{
			return Start.ToString() + ".." + End;
		}

		public static Range StartAt(Index start)
		{
			return start..Index.End;
		}

		public static Range EndAt(Index end)
		{
			return Index.Start..end;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public (int Offset, int Length) GetOffsetAndLength(int length)
		{
			Index start = Start;
			int num = ((!start.IsFromEnd) ? start.Value : (length - start.Value));
			Index end = End;
			int num2 = ((!end.IsFromEnd) ? end.Value : (length - end.Value));
			if ((uint)num2 > (uint)length || (uint)num > (uint)num2)
			{
				ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			return (Offset: num, Length: num2 - num);
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class ConstantExpectedAttribute : Attribute
	{
		public object? Min { get; set; }

		public object? Max { get; set; }
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[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.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[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.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[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.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false, AllowMultiple = false)]
	[ExcludeFromCodeCoverage]
	internal sealed class AsyncMethodBuilderAttribute : Attribute
	{
		public Type BuilderType { get; }

		public AsyncMethodBuilderAttribute(Type builderType)
		{
			BuilderType = builderType;
		}
	}
	[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
	{
	}
}