Decompiled source of ItemSpawner v0.1.1

plugins/com.atomic.itemspawner.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mirror;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;

[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("com.atomic.itemspawner")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyInformationalVersion("0.1.1")]
[assembly: AssemblyProduct("com.atomic.itemspawner")]
[assembly: AssemblyTitle("ItemSpawner")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.1.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 ItemSpawner
{
	[BepInPlugin("com.atomic.itemspawner", "ItemSpawner", "0.1.1")]
	public class Plugin : BaseUnityPlugin
	{
		public static ConfigEntry<KeyCode> toggleButton;

		public static List<PlayerInventory> playerList = new List<PlayerInventory>();

		public static Harmony harmony = null;

		private bool showMenu;

		private Vector2 scrollPosition = Vector2.zero;

		private Vector2 playerScrollPosition = Vector2.zero;

		private Rect windowRect = new Rect(100f, 100f, 600f, 400f);

		private GUIStyle windowStyle;

		private GUIStyle buttonStyle;

		private GUIStyle playerButtonStyle;

		private GUIStyle labelStyle;

		private GUIStyle selectedPlayerStyle;

		private bool stylesInitialized;

		private PlayerInventory selectedPlayer;

		private bool isHost;

		private bool hasBeenDrawn;

		public const string Id = "com.atomic.itemspawner";

		internal static ManualLogSource Log { get; private set; } = null;


		public static string Name => "ItemSpawner";

		public static string Version => "0.1.1";

		private void Awake()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
			harmony = new Harmony("com.atomic.itemspawner");
			harmony.PatchAll();
			toggleButton = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Keybinds", "Toggle Menu", (KeyCode)104, "The button that is pressed to toggle the item spawner GUI.");
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			stylesInitialized = false;
		}

		private void Update()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Keyboard current = Keyboard.current;
			if (current == null)
			{
				return;
			}
			if ((Object)(object)SingletonBehaviour<GameManager>.instance != (Object)null)
			{
				if ((Object)(object)SingletonBehaviour<GameManager>.instance.localPlayerInventory == (Object)null)
				{
					return;
				}
				isHost = ((NetworkBehaviour)SingletonBehaviour<GameManager>.instance.localPlayerInventory).isHost;
			}
			if (playerList.Count != 0)
			{
				Type typeFromHandle = typeof(Key);
				KeyCode value = toggleButton.Value;
				Key val = (Key)Enum.Parse(typeFromHandle, ((object)(KeyCode)(ref value)).ToString(), ignoreCase: true);
				if (((ButtonControl)current[val]).wasPressedThisFrame)
				{
					ToggleMenu();
				}
			}
		}

		private void ToggleMenu()
		{
			showMenu = !showMenu;
			if (showMenu)
			{
				hasBeenDrawn = false;
				selectedPlayer = SingletonBehaviour<GameManager>.instance?.localPlayerInventory;
				Cursor.lockState = (CursorLockMode)0;
				Cursor.visible = true;
			}
			else
			{
				Cursor.lockState = (CursorLockMode)1;
				Cursor.visible = false;
			}
		}

		private void OnGUI()
		{
			//IL_0049: 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)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			if (showMenu)
			{
				InitializeStyles();
				if (!hasBeenDrawn)
				{
					GUI.color = new Color(1f, 1f, 1f, 0.95f);
					hasBeenDrawn = true;
				}
				else if (((Rect)(ref windowRect)).Contains(Event.current.mousePosition))
				{
					GUI.color = new Color(1f, 1f, 1f, 0.95f);
				}
				else
				{
					GUI.color = new Color(1f, 1f, 1f, 0.3f);
				}
				windowRect = GUILayout.Window(0, windowRect, new WindowFunction(DrawWindow), "Item Spawner", windowStyle, Array.Empty<GUILayoutOption>());
			}
		}

		private void InitializeStyles()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Expected O, but got Unknown
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Expected O, but got Unknown
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Expected O, but got Unknown
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			if (!stylesInitialized)
			{
				windowStyle = new GUIStyle(GUI.skin.window);
				windowStyle.normal.background = MakeTexture(2, 2, new Color(0.1f, 0.1f, 0.1f, 0.9f));
				buttonStyle = new GUIStyle(GUI.skin.button);
				buttonStyle.normal.background = MakeTexture(2, 2, new Color(0.3f, 0.3f, 0.3f, 0.8f));
				buttonStyle.hover.background = MakeTexture(2, 2, new Color(0.4f, 0.4f, 0.4f, 0.9f));
				buttonStyle.active.background = MakeTexture(2, 2, new Color(0.2f, 0.2f, 0.2f, 0.9f));
				buttonStyle.normal.textColor = Color.white;
				buttonStyle.hover.textColor = Color.yellow;
				buttonStyle.alignment = (TextAnchor)3;
				buttonStyle.padding = new RectOffset(10, 10, 5, 5);
				playerButtonStyle = new GUIStyle(GUI.skin.button);
				playerButtonStyle.normal.background = MakeTexture(2, 2, new Color(0.25f, 0.25f, 0.25f, 0.8f));
				playerButtonStyle.hover.background = MakeTexture(2, 2, new Color(0.35f, 0.35f, 0.35f, 0.9f));
				playerButtonStyle.active.background = MakeTexture(2, 2, new Color(0.2f, 0.2f, 0.2f, 0.9f));
				playerButtonStyle.normal.textColor = Color.white;
				playerButtonStyle.hover.textColor = Color.yellow;
				playerButtonStyle.alignment = (TextAnchor)3;
				playerButtonStyle.padding = new RectOffset(10, 10, 5, 5);
				selectedPlayerStyle = new GUIStyle(GUI.skin.button);
				selectedPlayerStyle.normal.background = MakeTexture(2, 2, new Color(0.4f, 0.8f, 0.4f, 0.8f));
				selectedPlayerStyle.hover.background = MakeTexture(2, 2, new Color(0.5f, 0.9f, 0.5f, 0.9f));
				selectedPlayerStyle.active.background = MakeTexture(2, 2, new Color(0.3f, 0.7f, 0.3f, 0.9f));
				selectedPlayerStyle.normal.textColor = Color.white;
				selectedPlayerStyle.hover.textColor = Color.yellow;
				selectedPlayerStyle.alignment = (TextAnchor)3;
				selectedPlayerStyle.padding = new RectOffset(10, 10, 5, 5);
				labelStyle = new GUIStyle(GUI.skin.label);
				labelStyle.normal.textColor = Color.white;
				labelStyle.fontSize = 14;
				labelStyle.fontStyle = (FontStyle)1;
				labelStyle.alignment = (TextAnchor)4;
				stylesInitialized = true;
			}
		}

		private Texture2D MakeTexture(int width, int height, Color color)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = color;
			}
			Texture2D val = new Texture2D(width, height);
			val.SetPixels(array);
			val.Apply();
			((Object)val).hideFlags = (HideFlags)52;
			return val;
		}

		private void DrawWindow(int windowID)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			GUI.DragWindow(new Rect(0f, 0f, 10000f, 30f));
			if (!isHost)
			{
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				GUILayout.FlexibleSpace();
				GUILayout.Label("You must be the host to use this menu!", labelStyle, Array.Empty<GUILayoutOption>());
				GUILayout.Space(10f);
				if (GUILayout.Button("Close", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
				{
					ToggleMenu();
				}
				GUILayout.FlexibleSpace();
				GUILayout.EndVertical();
				return;
			}
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) });
			GUILayout.Label("Available Items", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			if ((Object)(object)SingletonBehaviour<GameManager>.instance?.allItems == (Object)null)
			{
				GUILayout.Label("Items not loaded yet...", Array.Empty<GUILayoutOption>());
			}
			else
			{
				ItemData[] items = SingletonBehaviour<GameManager>.instance.allItems.items;
				if ((Object)(object)selectedPlayer == (Object)null)
				{
					GUILayout.Label("Select a player first...", Array.Empty<GUILayoutOption>());
				}
				else
				{
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label("Giving to:", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
					GUILayout.Label(GetPlayerName(selectedPlayer), buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(25f) });
					GUILayout.EndHorizontal();
					GUILayout.Space(10f);
					scrollPosition = GUILayout.BeginScrollView(scrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
					{
						GUILayout.Width(280f),
						GUILayout.Height(250f)
					});
					ItemData[] array = items;
					foreach (ItemData val in array)
					{
						if (val != null)
						{
							GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
							if ((Object)(object)val.Icon != (Object)null)
							{
								GUILayout.Box((Texture)(object)val.Icon.texture, (GUILayoutOption[])(object)new GUILayoutOption[2]
								{
									GUILayout.Width(32f),
									GUILayout.Height(32f)
								});
							}
							if (GUILayout.Button(val.LocalizedName.GetLocalizedString(), buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(40f) }))
							{
								GiveItem(val, selectedPlayer);
							}
							GUILayout.EndHorizontal();
							GUILayout.Space(2f);
						}
					}
					GUILayout.EndScrollView();
				}
			}
			GUILayout.EndVertical();
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) });
			GUILayout.Label("Players", labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(10f);
			playerScrollPosition = GUILayout.BeginScrollView(playerScrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(260f),
				GUILayout.Height(300f)
			});
			IOrderedEnumerable<PlayerInventory> orderedEnumerable = from p in playerList
				where (Object)(object)p != (Object)null && (Object)(object)p.PlayerInfo != (Object)null
				orderby (Object)(object)p == (Object)(object)SingletonBehaviour<GameManager>.instance?.localPlayerInventory descending, GetPlayerName(p)
				select p;
			foreach (PlayerInventory item in orderedEnumerable)
			{
				if (!((Object)(object)item == (Object)null) && !((Object)(object)item.PlayerInfo == (Object)null))
				{
					string text = GetPlayerName(item);
					if ((Object)(object)item == (Object)(object)SingletonBehaviour<GameManager>.instance?.localPlayerInventory)
					{
						text += " (You)";
					}
					GUIStyle val2 = (((Object)(object)item == (Object)(object)selectedPlayer) ? selectedPlayerStyle : playerButtonStyle);
					if (GUILayout.Button(text, val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
					{
						selectedPlayer = item;
						Log.LogInfo((object)("Selected player: " + text));
					}
				}
			}
			GUILayout.EndScrollView();
			GUILayout.EndVertical();
			GUILayout.EndHorizontal();
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Close", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
			{
				ToggleMenu();
			}
		}

		private string GetPlayerName(PlayerInventory player)
		{
			try
			{
				object obj;
				if (player == null)
				{
					obj = null;
				}
				else
				{
					PlayerInfo playerInfo = player.PlayerInfo;
					obj = ((playerInfo != null) ? playerInfo.PlayerId : null);
				}
				if ((Object)obj != (Object)null)
				{
					return player.PlayerInfo.PlayerId.PlayerNameNoRichText;
				}
			}
			catch (Exception ex)
			{
				Log.LogError((object)("Error getting player name: " + ex.Message));
			}
			return "Unknown Player";
		}

		private void GiveItem(ItemData item, PlayerInventory player)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null)
			{
				Log.LogError((object)"PlayerInventory is null");
				return;
			}
			if (!isHost)
			{
				Log.LogWarning((object)"Non-host attempted to spawn item");
				return;
			}
			player.ServerTryAddItem(item.Type, item.MaxUses);
			Log.LogInfo((object)("Spawned item: " + item.LocalizedName.GetLocalizedString() + " for player: " + GetPlayerName(player)));
		}
	}
	[HarmonyPatch]
	public static class ItemSpawnerPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerInventory), "Awake")]
		public static void PlayerInventoryPatch(PlayerInventory __instance)
		{
			List<PlayerInventory> playerList = Plugin.playerList;
			if (!playerList.Contains(__instance))
			{
				((Component)__instance).gameObject.AddComponent<PlayerInventoryHelper>();
				playerList.Add(__instance);
				Plugin.Log.LogInfo((object)("Player: " + GetPlayerNameSafe(__instance) + " was added to the list."));
			}
		}

		private static string GetPlayerNameSafe(PlayerInventory player)
		{
			try
			{
				object obj;
				if (player == null)
				{
					obj = null;
				}
				else
				{
					PlayerInfo playerInfo = player.PlayerInfo;
					obj = ((playerInfo != null) ? playerInfo.PlayerId : null);
				}
				if ((Object)obj != (Object)null)
				{
					return player.PlayerInfo.PlayerId.PlayerNameNoRichText;
				}
			}
			catch
			{
			}
			return "Unknown Player";
		}
	}
	public class PlayerInventoryHelper : MonoBehaviour
	{
		private void OnDestroy()
		{
			PlayerInventory component = ((Component)this).gameObject.GetComponent<PlayerInventory>();
			if (!((Object)(object)component != (Object)null))
			{
				return;
			}
			string text = "Unknown Player";
			try
			{
				PlayerInfo playerInfo = component.PlayerInfo;
				if ((Object)(object)((playerInfo != null) ? playerInfo.PlayerId : null) != (Object)null)
				{
					text = component.PlayerInfo.PlayerId.PlayerNameNoRichText;
				}
			}
			catch
			{
			}
			Plugin.Log.LogInfo((object)("Player: " + text + " was removed from the list."));
			Plugin.playerList.Remove(component);
		}
	}
}
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
	{
	}
}