Decompiled source of LethalBotsNavMeshProject v2.1.0

plugins/TRizzle-LethalBots NavMesh Project/LethalBotsNavMeshProject.dll

Decompiled 5 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using HarmonyLib;
using LethalBots.Constants;
using LethalBotsNavMeshProject.Editor;
using LethalBotsNavMeshProject.Helpers;
using LethalBotsNavMeshProject.MoonNavMeshes;
using Microsoft.CodeAnalysis;
using NavMeshLib;
using Unity.AI.Navigation;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalBotsNavMeshProject")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.0+abe908b71193971ad308597e5cd892e1eb1fbdd8")]
[assembly: AssemblyProduct("LethalBotsNavMeshProject")]
[assembly: AssemblyTitle("LethalBotsNavMeshProject")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: TypeForwardedTo(typeof(AllowNullAttribute))]
[assembly: TypeForwardedTo(typeof(DisallowNullAttribute))]
[assembly: TypeForwardedTo(typeof(MaybeNullAttribute))]
[assembly: TypeForwardedTo(typeof(MaybeNullWhenAttribute))]
[assembly: TypeForwardedTo(typeof(NotNullAttribute))]
[assembly: TypeForwardedTo(typeof(NotNullIfNotNullAttribute))]
[assembly: TypeForwardedTo(typeof(NotNullWhenAttribute))]
[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 LethalBotsNavMeshProject
{
	public class Config : SyncedConfig2<Config>
	{
		private const string ConfigSection = "Lethal Bots NavMesh Project";

		private const string ConfigDebug = "Debug";

		[SyncedEntryField]
		public SyncedEntry<bool> AutoGenerateLadderLinks;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableExperimentationNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableAssuranceNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableVowNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableOffenceNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableAdamanceNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableEmbrionNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableArtificeNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableTitanNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableRendNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableDineNav;

		[SyncedEntryField]
		public SyncedEntry<bool> EnableMarchNav;

		public ConfigEntry<bool> EnableDebugLog;

		public Config(ConfigFile cfg)
			: base("T-Rizzle.LethalBotsNavMeshProject")
		{
			cfg.SaveOnConfigSet = false;
			AutoGenerateLadderLinks = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Auto Generate Ladder Links", true, "Should we automatically generate NavMeshLinks for the bots on ladders found in the level. This includes ladders in interiors. \n Only bots will be able to use the newly generated links!");
			EnableExperimentationNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Experimentation Nav Improvements", true, "If you are using a modified version of Experimentation, you may want to disable these improvements!");
			EnableAssuranceNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Assurance Nav Improvements", true, "If you are using a modified version of Assurance, you may want to disable these improvements!");
			EnableVowNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Vow Nav Improvements", true, "If you are using a modified version of Vow, you may want to disable these improvements!");
			EnableOffenceNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Offence Nav Improvements", true, "If you are using a modified version of Offence, you may want to disable these improvements!");
			EnableAdamanceNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Adamance Nav Improvements", true, "If you are using a modified version of Adamance, you may want to disable these improvements!");
			EnableEmbrionNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Embrion Nav Improvements", true, "If you are using a modified version of Embrion, you may want to disable these improvements!");
			EnableArtificeNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Artifice Nav Improvements", true, "If you are using a modified version of Artifice, you may want to disable these improvements!");
			EnableTitanNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Titan Nav Improvements", true, "If you are using a modified version of Titan, you may want to disable these improvements!");
			EnableRendNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Rend Nav Improvements", true, "If you are using a modified version of Rend, you may want to disable these improvements!");
			EnableDineNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable Dine Nav Improvements", true, "If you are using a modified version of Dine, you may want to disable these improvements!");
			EnableMarchNav = SyncedBindingExtensions.BindSyncedEntry<bool>(cfg, "Lethal Bots NavMesh Project", "Enable March Nav Improvements", true, "If you are using a modified version of March, you may want to disable these improvements!");
			EnableDebugLog = cfg.Bind<bool>("Debug", "EnableDebugLog  (Client only)", true, "Enable the debug logs used for this mod.");
			ClearUnusedEntries(cfg);
			cfg.SaveOnConfigSet = true;
		}

		private void ClearUnusedEntries(ConfigFile cfg)
		{
			PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(cfg, null);
			dictionary.Clear();
			cfg.Save();
		}
	}
	public static class NavMeshPrefabManager
	{
		public const string BUNDLE_EXTENSION = ".lethalbotsnavmesh";

		private const string EXPERIMENTATION_MOON_SCENE_NAME = "41 Experimentation.Level1Experimentation";

		private const string ASSURANCE_MOON_SCENE_NAME = "220 Assurance.Level2Assurance";

		private const string VOW_MOON_SCENE_NAME = "56 Vow.Level3Vow";

		private const string OFFENSE_MOON_SCENE_NAME = "21 Offense.Level7Offense";

		private const string ADAMANCE_MOON_SCENE_NAME = "20 Adamance.Level10Adamance";

		private const string EMBRION_MOON_SCENE_NAME = "5 Embrion.Level11Embrion";

		private const string ARTIFICE_MOON_SCENE_NAME = "68 Artifice.Level9Artifice";

		private const string TITAN_MOON_SCENE_NAME = "8 Titan.Level8Titan";

		private const string REND_MOON_SCENE_NAME = "85 Rend.Level5Rend";

		private const string DINE_MOON_SCENE_NAME = "7 Dine.Level6Dine";

		private const string MARCH_MOON_SCENE_NAME = "61 March.Level4March";

		public static readonly Dictionary<string, MoonNavMesh> NavMeshPrefabs = new Dictionary<string, MoonNavMesh>();

		public static readonly Dictionary<string, CustomBotNavMeshInfo.CustomBotNavMeshInfoData> NavMeshAssetPaths = new Dictionary<string, CustomBotNavMeshInfo.CustomBotNavMeshInfoData>();

		public static readonly UnityEvent LoadCustomNavmeshPrefabs = new UnityEvent();

		private static GameObject ExperimentationNavPrefab = null;

		private static GameObject AssuranceNavPrefab = null;

		private static GameObject VowNavPrefab = null;

		private static GameObject OffenseNavPrefab = null;

		private static GameObject AdamanceNavPrefab = null;

		private static GameObject EmbrionNavPrefab = null;

		private static GameObject ArtificeNavPrefab = null;

		private static GameObject TitanNavPrefab = null;

		private static GameObject RendNavPrefab = null;

		private static GameObject DineNavPrefab = null;

		private static GameObject MarchNavPrefab = null;

		internal static void LoadPrefabs()
		{
			if (!ArePrefabsLoaded())
			{
				AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Plugin.DirectoryName, "lethalbotsnavmesh"));
				if ((Object)(object)val == (Object)null)
				{
					Plugin.LogFatal("Failed to load custom assets.");
					return;
				}
				ExperimentationNavPrefab = val.LoadAsset<GameObject>("ExperimentationNavMesh");
				AssuranceNavPrefab = val.LoadAsset<GameObject>("AssuranceNavMesh");
				VowNavPrefab = val.LoadAsset<GameObject>("VowNavMesh");
				OffenseNavPrefab = val.LoadAsset<GameObject>("OffenseNavMesh");
				AdamanceNavPrefab = val.LoadAsset<GameObject>("AdamanceNavMesh");
				EmbrionNavPrefab = val.LoadAsset<GameObject>("EmbrionNavMesh");
				ArtificeNavPrefab = val.LoadAsset<GameObject>("ArtificeNavMesh");
				TitanNavPrefab = val.LoadAsset<GameObject>("TitanNavMesh");
				RendNavPrefab = val.LoadAsset<GameObject>("RendNavMesh");
				DineNavPrefab = val.LoadAsset<GameObject>("DineNavMesh");
				MarchNavPrefab = val.LoadAsset<GameObject>("MarchNavMesh");
				val.Unload(false);
			}
			NavMeshPrefabs.Clear();
			LoadCustomNavmeshPrefabs.Invoke();
			NavMeshPrefabs.TryAdd("41 Experimentation.Level1Experimentation", new ExperimentationNavMesh(ExperimentationNavPrefab));
			NavMeshPrefabs.TryAdd("220 Assurance.Level2Assurance", new AssuranceNavMesh(AssuranceNavPrefab));
			NavMeshPrefabs.TryAdd("56 Vow.Level3Vow", new VowNavMesh(VowNavPrefab));
			NavMeshPrefabs.TryAdd("21 Offense.Level7Offense", new OffenceNavMesh(OffenseNavPrefab));
			NavMeshPrefabs.TryAdd("20 Adamance.Level10Adamance", new AdamanceNavMesh(AdamanceNavPrefab));
			NavMeshPrefabs.TryAdd("5 Embrion.Level11Embrion", new EmbrionNavMesh(EmbrionNavPrefab));
			NavMeshPrefabs.TryAdd("68 Artifice.Level9Artifice", new ArtificeNavMesh(ArtificeNavPrefab));
			NavMeshPrefabs.TryAdd("8 Titan.Level8Titan", new TitanNavMesh(TitanNavPrefab));
			NavMeshPrefabs.TryAdd("85 Rend.Level5Rend", new RendNavMesh(RendNavPrefab));
			NavMeshPrefabs.TryAdd("7 Dine.Level6Dine", new DineNavMesh(DineNavPrefab));
			NavMeshPrefabs.TryAdd("61 March.Level4March", new MarchNavMesh(MarchNavPrefab));
			LoadCustomNavMeshPrefabs();
		}

		public static GameObject? GetPrefabForLevel(string levelName)
		{
			if (!NavMeshPrefabs.TryGetValue(levelName, out MoonNavMesh value))
			{
				Plugin.LogError("No navmesh prefab found for level with scene name: " + levelName);
				return null;
			}
			return value.GetNavPrefab();
		}

		public static bool IsValidLevel(string levelName, out bool prefabEnabled)
		{
			if (!NavMeshPrefabs.TryGetValue(levelName, out MoonNavMesh value))
			{
				prefabEnabled = true;
				return false;
			}
			prefabEnabled = value.IsPrefabEnabled();
			return true;
		}

		public static bool ArePrefabsLoaded()
		{
			if ((Object)(object)ExperimentationNavPrefab != (Object)null && (Object)(object)AssuranceNavPrefab != (Object)null && (Object)(object)VowNavPrefab != (Object)null && (Object)(object)OffenseNavPrefab != (Object)null && (Object)(object)AdamanceNavPrefab != (Object)null && (Object)(object)EmbrionNavPrefab != (Object)null && (Object)(object)ArtificeNavPrefab != (Object)null && (Object)(object)TitanNavPrefab != (Object)null && (Object)(object)RendNavPrefab != (Object)null)
			{
				return (Object)(object)DineNavPrefab != (Object)null;
			}
			return false;
		}

		public static void LogPrefabStatus()
		{
			foreach (KeyValuePair<string, MoonNavMesh> navMeshPrefab in NavMeshPrefabs)
			{
				MoonNavMesh value = navMeshPrefab.Value;
				if (value != null)
				{
					GameObject navPrefab = value.GetNavPrefab();
					if ((Object)(object)navPrefab != (Object)null)
					{
						Plugin.LogInfo($"Navmesh prefab found for level with scene name: {navMeshPrefab.Key}. \n Is Prefab Enabled: {value.IsPrefabEnabled()}");
						continue;
					}
				}
				Plugin.LogWarning("No navmesh prefab found for level with scene name: " + navMeshPrefab.Key);
			}
		}

		internal static async void LoadCustomNavMeshPrefabs()
		{
			List<string> foundBundles = new List<string>();
			await Task.Run(async delegate
			{
				string pluginPath = Paths.PluginPath;
				Plugin.LogDebug("Searching for bot NavMeshes in: " + pluginPath);
				foreach (string item in Directory.EnumerateFiles(pluginPath, "*.lethalbotsnavmesh", SearchOption.AllDirectories))
				{
					if (!string.IsNullOrWhiteSpace(item))
					{
						string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(item);
						Plugin.LogDebug("Found " + fileNameWithoutExtension + " with path " + item);
						foundBundles.Add(item);
					}
				}
			});
			NavMeshAssetPaths.Clear();
			for (int num = 0; num < foundBundles.Count; num++)
			{
				string text = foundBundles[num];
				AssetBundle val = AssetBundle.LoadFromFile(text);
				if ((Object)(object)val == (Object)null)
				{
					Plugin.LogWarning("Failed to load custom assets from " + text + ". Skipping!");
					continue;
				}
				GameObject[] array = val.LoadAllAssets<GameObject>();
				List<CustomBotNavMeshInfo> list = new List<CustomBotNavMeshInfo>();
				GameObject[] array2 = array;
				foreach (GameObject val2 in array2)
				{
					CustomBotNavMeshInfo component = val2.GetComponent<CustomBotNavMeshInfo>();
					if ((Object)(object)component != (Object)null)
					{
						list.Add(component);
					}
				}
				HashSet<string> hashSet = new HashSet<string>();
				if (list == null || list.Count == 0)
				{
					Plugin.LogWarning("Failed to find CustomBotNavMeshInfo in " + text + ". Is it at the root of the prefab?");
					val.Unload(true);
					continue;
				}
				for (int num3 = 0; num3 < list.Count; num3++)
				{
					CustomBotNavMeshInfo customBotNavMeshInfo = list[num3];
					if ((Object)(object)customBotNavMeshInfo != (Object)null)
					{
						string levelName = customBotNavMeshInfo.GetLevelName();
						string name = ((Object)customBotNavMeshInfo).name;
						if (NavMeshAssetPaths.ContainsKey(levelName))
						{
							Plugin.LogWarning("Duplicate NavMesh asset found for level with scene name: " + levelName + ". Overwriting!");
						}
						if (!hashSet.Add(name))
						{
							Plugin.LogError("Asset with name " + name + " is already loaded for a different level in bundle " + text + ". Overwriting! THIS WILL CAUSE ISSUES!");
						}
						NavMeshAssetPaths[levelName] = new CustomBotNavMeshInfo.CustomBotNavMeshInfoData
						{
							filePath = text,
							assetName = name
						};
					}
				}
				val.Unload(true);
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "T-Rizzle.LethalBotsNavMeshProject";

		public const string PLUGIN_NAME = "LethalBotsNavMeshProject";

		public const string PLUGIN_VERSION = "2.1.0";
	}
	[BepInPlugin("T-Rizzle.LethalBotsNavMeshProject", "LethalBotsNavMeshProject", "2.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		public const string BUNDLE_NAME = "lethalbotsnavmesh";

		internal static string DirectoryName;

		internal static ManualLogSource Logger;

		internal static Config Config;

		private readonly Harmony _harmony = new Harmony("T-Rizzle.LethalBotsNavMeshProject");

		private void Awake()
		{
			DirectoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			Logger = ((BaseUnityPlugin)this).Logger;
			Config = new Config(((BaseUnityPlugin)this).Config);
			NavMeshPrefabManager.LoadPrefabs();
			if (!NavMeshPrefabManager.ArePrefabsLoaded())
			{
				LogWarning("Failed to load some or all of the nav mesh prefabs from the asset bundle.");
				LogWarning("Some levels may not have custom nav meshes.");
			}
			NavMeshPrefabManager.LogPrefabStatus();
			SceneManager.sceneLoaded += OnSceneLoaded;
			try
			{
				_harmony.PatchAll(typeof(RoundManagerPatch));
			}
			catch (Exception arg)
			{
				Logger.LogError((object)$"Failed to patch with error {arg}");
			}
			LogInfo("Plugin T-Rizzle.LethalBotsNavMeshProject is loaded!");
		}

		private static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			StartOfRound instance = StartOfRound.Instance;
			if ((Object)(object)instance == (Object)null || (Object)(object)instance.currentLevel == (Object)null)
			{
				return;
			}
			string planetName = instance.currentLevel.PlanetName;
			string name = ((Scene)(ref scene)).name;
			string text = planetName + "." + name;
			AssetBundle val = null;
			GameObject val2 = null;
			if (!NavMeshPrefabManager.IsValidLevel(text, out var prefabEnabled) || !prefabEnabled)
			{
				if (!prefabEnabled || !NavMeshPrefabManager.NavMeshAssetPaths.TryGetValue(text, out var value) || !value.IsPrefabEnabled)
				{
					return;
				}
				LogInfo("Attempting to load custom NavMesh for " + text + " with path " + value.filePath);
				val = AssetBundle.LoadFromFile(value.filePath);
				if ((Object)(object)val == (Object)null)
				{
					LogError("Failed to load custom assets with path " + value.filePath + ". A!");
					return;
				}
				GameObject val3 = val.LoadAsset<GameObject>(value.assetName);
				if ((Object)(object)val3 == (Object)null)
				{
					LogError("Failed to load custom assets with asset name " + value.assetName + ". B!");
					val.Unload(true);
					return;
				}
				CustomBotNavMeshInfo component = val3.GetComponent<CustomBotNavMeshInfo>();
				if ((Object)(object)component == (Object)null)
				{
					LogError("Failed to find CustomBotNavMeshInfo with asset name " + value.assetName + ". C!");
					val.Unload(true);
					return;
				}
				val2 = component.GetBotNavMeshRoot();
				if ((Object)(object)val2 == (Object)null)
				{
					LogError("Failed to load custom assets. Root Object was null. D!");
					val.Unload(true);
					return;
				}
				LogInfo("Assets successfully loaded!");
			}
			try
			{
				LogInfo("Instantiating NavMesh prefab for moon: " + planetName + " with scene name " + name);
				val2 = val2 ?? NavMeshPrefabManager.GetPrefabForLevel(text);
				if ((Object)(object)val2 == (Object)null)
				{
					LogError("Failed to get navmesh prefab for level with scene name " + name);
					return;
				}
				Transform val4 = null;
				GameObject val5 = GameObject.FindGameObjectWithTag("OutsideLevelNavMesh") ?? GameObject.Find("Environment");
				if ((Object)(object)val5 == (Object)null)
				{
					LogError("Failed to find Environment object in the scene!");
					return;
				}
				Transform val6 = val5.transform.Find("NavMeshColliders");
				if ((Object)(object)val6 == (Object)null)
				{
					LogWarning("Failed to find NavMeshColliders! Fallback to parenting to the Environment object.");
					LogError("This may cause the NavFixes to fail to work. Report this to the mod devs!");
					val4 = val5.transform;
				}
				else
				{
					val4 = val6;
				}
				GameObject val7 = Object.Instantiate<GameObject>(val2, val4);
				Transform val8 = val7.transform.Find("LethalBotNavMesh");
				if ((Object)(object)val8 != (Object)null)
				{
					LogInfo("Loading Bot Specific NavMesh!");
					NavMeshModifierVolume[] componentsInChildren = ((Component)val8).GetComponentsInChildren<NavMeshModifierVolume>(true);
					NavMeshModifierVolume[] array = componentsInChildren;
					foreach (NavMeshModifierVolume val9 in array)
					{
						val9.m_AffectedAgents = new List<int>(new int[1] { Const.LETHAL_BOT_NAV_SETTINGS_ID });
					}
					NavMeshSurface[] componentsInChildren2 = ((Component)val8).GetComponentsInChildren<NavMeshSurface>(true);
					NavMeshSurface[] array2 = componentsInChildren2;
					foreach (NavMeshSurface val10 in array2)
					{
						val10.agentTypeID = Const.LETHAL_BOT_NAV_SETTINGS_ID;
						if (((Behaviour)val10).isActiveAndEnabled)
						{
							NavMeshUtil.BuildNavMeshAsync(val10, (Action)null, (Action<NavMeshSurface>)null);
						}
						else
						{
							val10.BuildNavMesh();
						}
					}
					NavMeshLink[] componentsInChildren3 = ((Component)val8).GetComponentsInChildren<NavMeshLink>(true);
					NavMeshLink[] array3 = componentsInChildren3;
					foreach (NavMeshLink val11 in array3)
					{
						val11.agentTypeID = Const.LETHAL_BOT_NAV_SETTINGS_ID;
						val11.UpdateLink();
					}
					OffMeshLink[] componentsInChildren4 = ((Component)val8).GetComponentsInChildren<OffMeshLink>(true);
					if (componentsInChildren4.Length != 0)
					{
						LogWarning($"OffMeshLinks were detected on prefab {val2}. This is obsolete! You should use NavMeshLinks instead.");
						OffMeshLink[] array4 = componentsInChildren4;
						foreach (OffMeshLink val12 in array4)
						{
							NavMeshUtil.CopyOffMeshLink(val12, Const.LETHAL_BOT_NAV_SETTINGS_ID, true);
						}
					}
				}
				Transform val13 = val7.transform.Find("LethalBotCruiserNavMesh");
				if ((Object)(object)val13 != (Object)null)
				{
					LogInfo("Loading Bot Cruiser Specific NavMesh!");
					NavMeshModifierVolume[] componentsInChildren5 = ((Component)val13).GetComponentsInChildren<NavMeshModifierVolume>(true);
					NavMeshModifierVolume[] array5 = componentsInChildren5;
					foreach (NavMeshModifierVolume val14 in array5)
					{
						val14.m_AffectedAgents = new List<int>(new int[1] { Const.LETHAL_BOT_CRUISER_NAV_SETTINGS_ID });
					}
					NavMeshSurface[] componentsInChildren6 = ((Component)val13).GetComponentsInChildren<NavMeshSurface>(true);
					NavMeshSurface[] array6 = componentsInChildren6;
					foreach (NavMeshSurface val15 in array6)
					{
						val15.agentTypeID = Const.LETHAL_BOT_CRUISER_NAV_SETTINGS_ID;
						if (((Behaviour)val15).isActiveAndEnabled)
						{
							NavMeshUtil.BuildNavMeshAsync(val15, (Action)null, (Action<NavMeshSurface>)null);
						}
						else
						{
							val15.BuildNavMesh();
						}
					}
					NavMeshLink[] componentsInChildren7 = ((Component)val13).GetComponentsInChildren<NavMeshLink>(true);
					NavMeshLink[] array7 = componentsInChildren7;
					foreach (NavMeshLink val16 in array7)
					{
						val16.agentTypeID = Const.LETHAL_BOT_CRUISER_NAV_SETTINGS_ID;
						val16.UpdateLink();
					}
				}
				if (!((Object)(object)val8 == (Object)null) || !((Object)(object)val13 == (Object)null))
				{
					return;
				}
				LogWarning("Old NavMesh prefab is used for " + text + ". \n Ask the mod author to update as the old versions will be removed in a later update.");
				NavMeshModifierVolume[] componentsInChildren8 = val7.GetComponentsInChildren<NavMeshModifierVolume>(true);
				NavMeshModifierVolume[] array8 = componentsInChildren8;
				foreach (NavMeshModifierVolume val17 in array8)
				{
					val17.m_AffectedAgents = new List<int>(new int[1] { Const.LETHAL_BOT_NAV_SETTINGS_ID });
				}
				NavMeshSurface[] componentsInChildren9 = val7.GetComponentsInChildren<NavMeshSurface>(true);
				NavMeshSurface[] array9 = componentsInChildren9;
				foreach (NavMeshSurface val18 in array9)
				{
					val18.agentTypeID = Const.LETHAL_BOT_NAV_SETTINGS_ID;
					if (((Behaviour)val18).isActiveAndEnabled)
					{
						NavMeshUtil.BuildNavMeshAsync(val18, (Action)null, (Action<NavMeshSurface>)null);
					}
					else
					{
						val18.BuildNavMesh();
					}
				}
				NavMeshLink[] componentsInChildren10 = val7.GetComponentsInChildren<NavMeshLink>(true);
				NavMeshLink[] array10 = componentsInChildren10;
				foreach (NavMeshLink val19 in array10)
				{
					val19.agentTypeID = Const.LETHAL_BOT_NAV_SETTINGS_ID;
					val19.UpdateLink();
				}
				OffMeshLink[] componentsInChildren11 = val7.GetComponentsInChildren<OffMeshLink>(true);
				if (componentsInChildren11.Length != 0)
				{
					LogWarning($"OffMeshLinks were detected on prefab {val2}. This is obsolete! You should use NavMeshLinks instead.");
					OffMeshLink[] array11 = componentsInChildren11;
					foreach (OffMeshLink val20 in array11)
					{
						NavMeshUtil.CopyOffMeshLink(val20, Const.LETHAL_BOT_NAV_SETTINGS_ID, true);
					}
				}
			}
			catch (Exception arg)
			{
				LogError($"Exception occurred: {arg}");
			}
			finally
			{
				if ((Object)(object)val != (Object)null)
				{
					val.Unload(true);
					LogInfo("Unloaded now unneeded assets.");
				}
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogDebug(string debugLog)
		{
			if (Config.EnableDebugLog.Value)
			{
				Logger.LogDebug((object)debugLog);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogInfo(string infoLog)
		{
			Logger.LogInfo((object)infoLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogWarning(string warningLog)
		{
			Logger.LogWarning((object)warningLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogError(string errorLog)
		{
			Logger.LogError((object)errorLog);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void LogFatal(string errorLog)
		{
			Logger.LogFatal((object)errorLog);
		}
	}
	[HarmonyPatch(typeof(RoundManager))]
	public class RoundManagerPatch
	{
		[HarmonyPatch("BakeDunGenNavMesh")]
		[HarmonyPostfix]
		public static void BakeDunGenNavMesh_Postfix(RoundManager __instance)
		{
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			ClearExistingAutoLinks();
			if (!Plugin.Config.AutoGenerateLadderLinks.Value)
			{
				Plugin.LogDebug("Auto-generation of ladder links is disabled via config.");
				return;
			}
			Plugin.LogDebug("Auto creating NavMeshLinks for ladders on the moon for bots.");
			NavMeshLink[] navMeshLinks = Object.FindObjectsByType<NavMeshLink>((FindObjectsSortMode)0);
			InteractTrigger[] array = Object.FindObjectsByType<InteractTrigger>((FindObjectsSortMode)0);
			ExtensionLadderItem[] source = Object.FindObjectsByType<ExtensionLadderItem>((FindObjectsSortMode)0);
			foreach (InteractTrigger ladder in array)
			{
				if (!((Object)(object)ladder == (Object)null) && ladder.isLadder && (Object)(object)ladder.ladderHorizontalPosition != (Object)null && !source.Any((ExtensionLadderItem x) => (Object)(object)x.ladderScript == (Object)(object)ladder) && !NavMeshLinkExists(__instance, ladder, navMeshLinks))
				{
					Plugin.LogDebug($"Creating NavMeshLink for ladder {ladder} with name {((Object)ladder).name}");
					GameObject val = new GameObject("LadderNavMeshLink");
					val.transform.position = Vector3.zero;
					val.transform.rotation = Quaternion.identity;
					val.transform.localScale = Vector3.one;
					val.layer = LayerMask.NameToLayer("NavigationSurface");
					SceneManager.MoveGameObjectToScene(val, ((Component)ladder).gameObject.scene);
					Vector3 navMeshPosition = __instance.GetNavMeshPosition(ladder.topOfLadderPosition.position, __instance.navHit, 2.5f, -1);
					Vector3 navMeshPosition2 = __instance.GetNavMeshPosition(ladder.bottomOfLadderPosition.position, __instance.navHit, 2.5f, -1);
					Plugin.LogDebug($"Nav Position Top: {navMeshPosition} and Bottom: {navMeshPosition2}");
					NavMeshLink val2 = val.AddComponent<NavMeshLink>();
					val2.agentTypeID = Const.LETHAL_BOT_NAV_SETTINGS_ID;
					val2.area = NavMesh.GetAreaFromName("Climb");
					val2.startPoint = navMeshPosition;
					val2.endPoint = navMeshPosition2;
					val2.bidirectional = true;
					val2.autoUpdate = true;
					val2.width = 0f;
					val2.UpdateLink();
					NavMeshLinkHelper navMeshLinkHelper = ((Component)ladder).gameObject.AddComponent<NavMeshLinkHelper>();
					navMeshLinkHelper.AgentIndex = Const.LETHAL_BOT_NAV_SETTINGS_ID;
					navMeshLinkHelper.link = val2;
					navMeshLinkHelper.ladder = ladder;
					navMeshLinkHelper.topTransform = ladder.topOfLadderPosition;
					navMeshLinkHelper.bottomTransform = ladder.bottomOfLadderPosition;
				}
			}
		}

		private static bool NavMeshLinkExists(RoundManager instanceRM, InteractTrigger ladder, NavMeshLink[] navMeshLinks)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			Vector3 navMeshPosition = instanceRM.GetNavMeshPosition(ladder.topOfLadderPosition.position, instanceRM.navHit, 2.5f, -1);
			Vector3 navMeshPosition2 = instanceRM.GetNavMeshPosition(ladder.bottomOfLadderPosition.position, instanceRM.navHit, 2.5f, -1);
			foreach (NavMeshLink val in navMeshLinks)
			{
				if (!((Object)(object)val != (Object)null) || val.agentTypeID != Const.LETHAL_BOT_NAV_SETTINGS_ID || !val.bidirectional)
				{
					continue;
				}
				Vector3 val2 = ((Component)val).transform.TransformPoint(val.startPoint);
				Vector3 val3 = ((Component)val).transform.TransformPoint(val.endPoint);
				Vector3 val4 = navMeshPosition - val2;
				if (((Vector3)(ref val4)).sqrMagnitude < 6.25f)
				{
					val4 = navMeshPosition2 - val3;
					if (((Vector3)(ref val4)).sqrMagnitude < 6.25f)
					{
						return true;
					}
				}
				val4 = navMeshPosition - val3;
				if (((Vector3)(ref val4)).sqrMagnitude < 6.25f)
				{
					val4 = navMeshPosition2 - val2;
					if (((Vector3)(ref val4)).sqrMagnitude < 6.25f)
					{
						return true;
					}
				}
			}
			return false;
		}

		public static void ClearExistingAutoLinks()
		{
			NavMeshLinkHelper[] array = Object.FindObjectsByType<NavMeshLinkHelper>((FindObjectsInactive)1, (FindObjectsSortMode)0);
			foreach (NavMeshLinkHelper navMeshLinkHelper in array)
			{
				if ((Object)(object)navMeshLinkHelper != (Object)null)
				{
					Object.DestroyImmediate((Object)(object)navMeshLinkHelper);
				}
			}
			Plugin.LogDebug($"Cleared {array.Length} existing auto-generated NavMeshLinks.");
		}
	}
}
namespace LethalBotsNavMeshProject.MoonNavMeshes
{
	public class AdamanceNavMesh : MoonNavMesh
	{
		internal AdamanceNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableAdamanceNav);
		}
	}
	public class ArtificeNavMesh : MoonNavMesh
	{
		internal ArtificeNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableArtificeNav);
		}
	}
	public class AssuranceNavMesh : MoonNavMesh
	{
		internal AssuranceNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableAssuranceNav);
		}
	}
	public class DineNavMesh : MoonNavMesh
	{
		internal DineNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableDineNav);
		}
	}
	public class EmbrionNavMesh : MoonNavMesh
	{
		internal EmbrionNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableEmbrionNav);
		}
	}
	public class ExperimentationNavMesh : MoonNavMesh
	{
		internal ExperimentationNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableExperimentationNav);
		}
	}
	internal class MarchNavMesh : MoonNavMesh
	{
		internal MarchNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableMarchNav);
		}
	}
	public abstract class MoonNavMesh
	{
		protected GameObject? navPrefab;

		public virtual bool IsPrefabEnabled()
		{
			return true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public GameObject? GetNavPrefab()
		{
			return navPrefab;
		}
	}
	internal class OffenceNavMesh : MoonNavMesh
	{
		internal OffenceNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableOffenceNav);
		}
	}
	public class RendNavMesh : MoonNavMesh
	{
		internal RendNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableRendNav);
		}
	}
	public class TitanNavMesh : MoonNavMesh
	{
		internal TitanNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableTitanNav);
		}
	}
	public class VowNavMesh : MoonNavMesh
	{
		internal VowNavMesh(GameObject prefab)
		{
			navPrefab = prefab;
		}

		public override bool IsPrefabEnabled()
		{
			return SyncedEntry<bool>.op_Implicit(Plugin.Config.EnableVowNav);
		}
	}
}
namespace LethalBotsNavMeshProject.Helpers
{
	internal class NavMeshLinkHelper : MonoBehaviour
	{
		public NavMeshLink? link;

		public InteractTrigger? ladder;

		public Transform? topTransform;

		public Transform? bottomTransform;

		public float UpdateInterval = 0.5f;

		public int AgentIndex;

		private float updateTimer;

		private void Update()
		{
			updateTimer += Time.deltaTime;
			if (updateTimer > UpdateInterval)
			{
				updateTimer = 0f;
				SyncPoints();
			}
		}

		private void SyncPoints()
		{
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)link != (Object)null))
			{
				return;
			}
			bool flag = (Object)(object)ladder == (Object)null || ((Behaviour)ladder).isActiveAndEnabled;
			if (((Behaviour)link).enabled != flag)
			{
				((Behaviour)link).enabled = flag;
			}
			if (!flag)
			{
				return;
			}
			if ((Object)(object)topTransform == (Object)null)
			{
				if ((Object)(object)ladder == (Object)null)
				{
					return;
				}
				topTransform = ladder.topOfLadderPosition;
			}
			if ((Object)(object)bottomTransform == (Object)null)
			{
				if ((Object)(object)ladder == (Object)null)
				{
					return;
				}
				bottomTransform = ladder.bottomOfLadderPosition;
			}
			NavMeshQueryFilter val = default(NavMeshQueryFilter);
			((NavMeshQueryFilter)(ref val)).agentTypeID = AgentIndex;
			((NavMeshQueryFilter)(ref val)).areaMask = -1;
			NavMeshQueryFilter val2 = val;
			RoundManager instance = RoundManager.Instance;
			Vector3 navMeshPosition = NavMeshUtil.GetNavMeshPosition(instance, topTransform.position, val2, instance.navHit, 2.5f);
			Vector3 navMeshPosition2 = NavMeshUtil.GetNavMeshPosition(instance, bottomTransform.position, val2, instance.navHit, 2.5f);
			link.startPoint = navMeshPosition;
			link.endPoint = navMeshPosition2;
		}

		private void OnDestroy()
		{
			if ((Object)(object)link != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)((Component)link).gameObject);
			}
		}
	}
}
namespace LethalBotsNavMeshProject.Editor
{
	public class CustomBotNavMeshInfo : MonoBehaviour
	{
		public struct CustomBotNavMeshInfoData
		{
			public string filePath { get; internal set; }

			public string assetName { get; internal set; }

			public bool IsPrefabEnabled { get; set; }

			public CustomBotNavMeshInfoData()
			{
				filePath = string.Empty;
				assetName = string.Empty;
				IsPrefabEnabled = true;
			}
		}

		[Tooltip("The name SelectableLevel.PlanetName.SelectableLevel.sceneName of the level that this navmesh is for. \n Its recommended you use selectableLevel if possible.")]
		[SerializeField]
		private string levelName = string.Empty;

		[Tooltip("The level that this navmesh is for. If this is null, levelName will be used instead.")]
		[SerializeField]
		private SelectableLevel? selectableLevel;

		[Tooltip("The root GameObject of the navmesh prefab.")]
		[SerializeField]
		private GameObject botNavMeshRoot;

		public string GetLevelName()
		{
			if ((Object)(object)selectableLevel != (Object)null)
			{
				return selectableLevel.PlanetName + "." + selectableLevel.sceneName;
			}
			return levelName;
		}

		public GameObject GetBotNavMeshRoot()
		{
			return botNavMeshRoot;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	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)]
	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;
		}
	}
}