Decompiled source of EOSExt SecDoorTerminal v1.1.2

plugins/Inas07.EOSExt.SecurityDoorTerminal.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AIGraph;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Unity.IL2CPP;
using ChainedPuzzles;
using EOSExt.ExtraDoor;
using EOSExt.SecurityDoorTerminal.Definition;
using ExtraObjectiveSetup;
using ExtraObjectiveSetup.BaseClasses;
using ExtraObjectiveSetup.BaseClasses.CustomTerminalDefinition;
using ExtraObjectiveSetup.ExtendedWardenEvents;
using ExtraObjectiveSetup.Utils;
using GTFO.API;
using GTFO.API.Extensions;
using GameData;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppSystem;
using LevelGeneration;
using Localization;
using Microsoft.CodeAnalysis;
using Player;
using SecDoorTerminalInterface;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Inas07.EOSExt.SecurityDoorTerminal")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3d85c1a0a8e16d4a4f23de04978fc55ad957e373")]
[assembly: AssemblyProduct("Inas07.EOSExt.SecurityDoorTerminal")]
[assembly: AssemblyTitle("Inas07.EOSExt.SecurityDoorTerminal")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 EOSExt.SecurityDoorTerminal
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Inas.EOSExt.SecurityDoorTerminal", "EOSExt.SecurityDoorTerminal", "1.1.2")]
	public class EntryPoint : BasePlugin
	{
		public const string AUTHOR = "Inas";

		public const string PLUGIN_NAME = "EOSExt.SecurityDoorTerminal";

		public const string VERSION = "1.1.2";

		public override void Load()
		{
			SetupManagers();
			EOSLogger.Log("ExtraObjectiveSetup.SecurityDoorTerminal loaded.");
		}

		private void SetupManagers()
		{
			((ZoneDefinitionManager<SecurityDoorTerminalDefinition>)SecurityDoorTerminalManager.Current).Init();
		}
	}
	public static class ExtraDoorUtils
	{
		public const string PLUGIN_NAME = "Inas.EOSExt.ExtraDoor";

		public static bool PluginLoaded => ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey("Inas.EOSExt.ExtraDoor");

		public static LG_SecurityDoor GetFCDoor(string worldEventObjectFilter)
		{
			if (!PluginLoaded)
			{
				EOSLogger.Error("ExtraDoorUtils: plugin not loaded");
				return null;
			}
			return DoGetFCDoor(worldEventObjectFilter);
		}

		private static LG_SecurityDoor DoGetFCDoor(string worldEventObjectFilter)
		{
			return ForceConnectManager.Current.GetFCDoor(worldEventObjectFilter);
		}
	}
	public sealed class SecurityDoorTerminalManager : ZoneDefinitionManager<SecurityDoorTerminalDefinition>
	{
		private enum SDTWardenEvents
		{
			ADD_OVERRIDE_COMMAND = 1000
		}

		private const string OVERRIDE_COMMAND = "ACCESS_OVERRIDE";

		private List<(SecDoorTerminal sdt, SecurityDoorTerminalDefinition def)> levelSDTs = new List<(SecDoorTerminal, SecurityDoorTerminalDefinition)>();

		public static SecurityDoorTerminalManager Current { get; private set; }

		protected override string DEFINITION_NAME => "SecDoorTerminal";

		public bool TryGetZoneEntranceSecDoor(LG_Zone zone, out LG_SecurityDoor door)
		{
			if ((Object)(object)zone == (Object)null)
			{
				door = null;
				return false;
			}
			if ((Object)(object)zone.m_sourceGate == (Object)null)
			{
				door = null;
				return false;
			}
			if (zone.m_sourceGate.SpawnedDoor == null)
			{
				door = null;
				return false;
			}
			door = ((Il2CppObjectBase)zone.m_sourceGate.SpawnedDoor).TryCast<LG_SecurityDoor>();
			return (Object)(object)door != (Object)null;
		}

		protected override void AddDefinitions(ZoneDefinitionsForLevel<SecurityDoorTerminalDefinition> definitions)
		{
			base.Sort(definitions);
			base.AddDefinitions(definitions);
		}

		private void AddOverrideCommandWithAlarmText(SecDoorTerminal sdt)
		{
			if (sdt.CmdProcessor.HasRegisteredCommand((TERM_Command)254))
			{
				return;
			}
			string text = "<color=orange>" + Text.Get(841u) + "</color>";
			if ((Object)(object)sdt.LinkedDoorLocks.ChainedPuzzleToSolve != (Object)null && sdt.LinkedDoorLocks.ChainedPuzzleToSolve.Data.TriggerAlarmOnActivate)
			{
				string format = Text.Get(840u);
				ChainedPuzzleInstance chainedPuzzleToSolve = sdt.LinkedDoorLocks.ChainedPuzzleToSolve;
				text = "<color=orange>" + string.Format(format, (chainedPuzzleToSolve != null) ? chainedPuzzleToSolve.Data.PublicAlarmName : null) + "</color>";
				int num = text.IndexOf('[');
				if (num >= 0 && num < text.Length)
				{
					text = text.Insert(num, "\n");
				}
			}
			sdt.AddOverrideCommand("ACCESS_OVERRIDE", text, (Action<LG_ComputerTerminalCommandInterpreter>)null);
		}

		private unsafe void BuildSDT_UniqueCommands(SecDoorTerminal sdt, SecurityDoorTerminalDefinition def)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Invalid comparison between Unknown and I4
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			TerminalPlacementData val = new TerminalPlacementData
			{
				UniqueCommands = ListExtensions.ToIl2Cpp<CustomTerminalCommand>(def.TerminalSettings.UniqueCommands.ConvertAll((CustomCommand x) => x.ToVanillaDataType()))
			};
			((LG_FactoryJob)new LG_TerminalUniqueCommandsSetupJob(sdt.ComputerTerminal, val)).Build();
			TERM_Command val2 = default(TERM_Command);
			string text = default(string);
			string text2 = default(string);
			ChainedPuzzleInstance val3 = default(ChainedPuzzleInstance);
			foreach (CustomCommand uniqueCommand in def.TerminalSettings.UniqueCommands)
			{
				if (!sdt.ComputerTerminal.m_command.TryGetCommand(uniqueCommand.Command, ref val2, ref text, ref text2) || (int)sdt.ComputerTerminal.GetCommandRule(val2) != 0)
				{
					continue;
				}
				for (int i = 0; i < uniqueCommand.CommandEvents.Count; i++)
				{
					if (sdt.ComputerTerminal.TryGetChainPuzzleForCommand(val2, i, ref val3))
					{
						ChainedPuzzleInstance obj = val3;
						obj.OnPuzzleSolved += Action.op_Implicit(new Action(val3, (nint)(delegate*<ChainedPuzzleInstance, void>)(&EOSUtils.ResetProgress)));
					}
				}
			}
		}

		private void BuildLevelSDTs_UniqueCommands()
		{
			levelSDTs.ForEach(delegate((SecDoorTerminal sdt, SecurityDoorTerminalDefinition def) tp)
			{
				BuildSDT_UniqueCommands(tp.sdt, tp.def);
			});
		}

		private void BuildLevelSDTs_Passwords()
		{
			levelSDTs.ForEach(delegate((SecDoorTerminal sdt, SecurityDoorTerminalDefinition def) tp)
			{
				EOSTerminalUtils.BuildPassword(tp.sdt.ComputerTerminal, tp.def.TerminalSettings.PasswordData);
			});
		}

		private void WardenEvent_AddOverrideCommand(WardenObjectiveEventData e)
		{
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			Predicate<(SecDoorTerminal, SecurityDoorTerminalDefinition)> predicate = null;
			predicate = ((e.WorldEventObjectFilter == null || e.WorldEventObjectFilter.Length <= 0) ? ((Predicate<(SecDoorTerminal, SecurityDoorTerminalDefinition)>)delegate((SecDoorTerminal sdt, SecurityDoorTerminalDefinition def) tp)
			{
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				AIG_CourseNode courseNode = ((LG_ZoneExpander)tp.sdt.LinkedDoor.Gate).m_linksTo.m_courseNode;
				return courseNode.m_dimension.DimensionIndex == e.DimensionIndex && courseNode.LayerType == e.Layer && courseNode.m_zone.LocalIndex == e.LocalIndex;
			}) : ((Predicate<(SecDoorTerminal, SecurityDoorTerminalDefinition)>)(((SecDoorTerminal sdt, SecurityDoorTerminalDefinition def) tp) => e.WorldEventObjectFilter.Equals(tp.def.FCDoorWorldEventObjectFilter))));
			int num = levelSDTs.FindIndex(predicate);
			if (num == -1)
			{
				if (e.WorldEventObjectFilter != null && e.WorldEventObjectFilter.Length > 0)
				{
					EOSLogger.Error("SDT_AddOverrideCommand: SDT not found on ExtraDoor(WorldEventObjectFilter) '" + e.WorldEventObjectFilter + "'");
					return;
				}
				EOSLogger.Error($"SDT_AddOverrideCommand: SDT not found on door to {(e.DimensionIndex, e.Layer, e.LocalIndex)}");
				return;
			}
			SecDoorTerminal item = levelSDTs[num].sdt;
			AddOverrideCommandWithAlarmText(item);
			if (e.WorldEventObjectFilter != null && e.WorldEventObjectFilter.Length > 0)
			{
				EOSLogger.Debug("SDT_AddOverrideCommand: added for ExtraDoor(WorldEventObjectFilter) '" + e.WorldEventObjectFilter + "'");
				return;
			}
			EOSLogger.Debug($"SDT_AddOverrideCommand: added for SDT {(e.DimensionIndex, e.Layer, e.LocalIndex)}");
		}

		private SecDoorTerminal BuildSDT_Instantiation(SecurityDoorTerminalDefinition def)
		{
			//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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Expected O, but got Unknown
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Expected I4, but got Unknown
			LG_SecurityDoor door = null;
			if (def.FCDoorWorldEventObjectFilter != null && def.FCDoorWorldEventObjectFilter.Length > 0)
			{
				door = ExtraDoorUtils.GetFCDoor(def.FCDoorWorldEventObjectFilter);
				if ((Object)(object)door == (Object)null)
				{
					EOSLogger.Error("SecDoorTerminal: cannot find ExtraDoor with name '" + def.FCDoorWorldEventObjectFilter + "'");
					return null;
				}
			}
			else
			{
				var (val, val2, val3) = ((GlobalZoneIndex)def).GlobalZoneIndexTuple();
				LG_Zone val4 = default(LG_Zone);
				if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(val, val2, val3, ref val4) || (Object)(object)val4 == (Object)null)
				{
					EOSLogger.Error($"SecDoorTerminal: Cannot find target zone {((GlobalZoneIndex)def).GlobalZoneIndexTuple()}");
					return null;
				}
				if (!TryGetZoneEntranceSecDoor(val4, out door) || (Object)(object)door == (Object)null)
				{
					EOSLogger.Error($"SecDoorTerminal: Cannot find spawned sec-door for zone {((GlobalZoneIndex)def).GlobalZoneIndexTuple()}");
					return null;
				}
			}
			SecDoorTerminal sdt = SecDoorTerminal.Place(door, new TerminalStartStateData
			{
				StartingState = (TERM_State)0
			}, (TerminalPlacementData)null);
			sdt.BioscanScanSolvedBehaviour = def.StateSettings.OnPuzzleSolved;
			if (sdt == null)
			{
				EOSLogger.Error("SecDoorTerminal: Build failed - Can only attach SDT to regular security door");
				return null;
			}
			((LG_ZoneExpander)door.Gate).m_linksFrom.m_zone.TerminalsSpawnedInZone.Add(sdt.ComputerTerminal);
			sdt.BioscanScanSolvedBehaviour = def.StateSettings.OnPuzzleSolved;
			def.TerminalSettings.LocalLogFiles.ForEach(delegate(TerminalLogFileData log)
			{
				sdt.ComputerTerminal.AddLocalLog(log, true);
			});
			eDoorStatus status = sdt.LinkedDoor.m_sync.GetCurrentSyncState().status;
			eDoorStatus val5 = status;
			switch (val5 - 1)
			{
			case 2:
				if (def.StateSettings.LockedStateSetting.AccessibleWhenLocked)
				{
					sdt.LinkedDoorLocks.m_gateKeyItemNeeded.keyPickupCore.m_interact.OnPickedUpByPlayer += Action<PlayerAgent>.op_Implicit((Action<PlayerAgent>)delegate
					{
						sdt.SetTerminalActive(false);
					});
					sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenLocked);
					List<string> list4 = new List<string> { string.Format("<color=orange>" + Text.Get(849u) + "</color>", sdt.LinkedDoorLocks.m_gateKeyItemNeeded.PublicName) };
					sdt.ComputerTerminal.m_command.AddOutput(ListExtensions.ToIl2Cpp<string>(list4));
				}
				break;
			case 5:
				sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenLocked);
				if (def.StateSettings.LockedStateSetting.AccessibleWhenLocked)
				{
					List<string> list2 = new List<string> { string.Format("<color=orange>" + Text.Get(842u) + "</color>", sdt.LinkedDoorLocks.m_powerGeneratorNeeded.PublicName) };
					sdt.ComputerTerminal.m_command.AddOutput(ListExtensions.ToIl2Cpp<string>(list2));
				}
				break;
			case 14:
				sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenLocked);
				if (def.StateSettings.LockedStateSetting.AccessibleWhenLocked)
				{
					List<string> list = new List<string> { string.Format("<color=orange>" + Text.Get(843u) + "</color>", sdt.LinkedDoorLocks.m_bulkheadDCNeeded.PublicName) };
					sdt.ComputerTerminal.m_command.AddOutput(ListExtensions.ToIl2Cpp<string>(list));
				}
				break;
			case 6:
				sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenLocked);
				if (def.StateSettings.LockedStateSetting.AccessibleWhenLocked)
				{
					List<string> list3 = new List<string> { sdt.LinkedDoorLocks.m_intCustomMessage.m_message };
					sdt.ComputerTerminal.m_command.AddOutput(ListExtensions.ToIl2Cpp<string>(list3));
				}
				else
				{
					sdt.SetCustomMessageActive(true);
				}
				break;
			case 0:
			case 3:
			case 4:
			case 8:
				if (def.StateSettings.OverrideCommandAccessibility != OverrideCmdAccess.ADDED_BY_WARDEN_EVENT)
				{
					AddOverrideCommandWithAlarmText(sdt);
				}
				sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenUnlocked);
				break;
			}
			sdt.LinkedDoor.m_sync.OnDoorStateChange += Action<pDoorState, bool>.op_Implicit((Action<pDoorState, bool>)delegate(pDoorState state, bool isDropin)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Expected I4, but got Unknown
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Invalid comparison between Unknown and I4
				eDoorStatus status3 = state.status;
				eDoorStatus val7 = status3;
				switch (val7 - 3)
				{
				case 0:
				case 3:
				case 4:
				case 12:
					sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenLocked);
					if ((int)state.status == 7)
					{
						sdt.SetCustomMessageActive(true);
					}
					break;
				case 1:
				case 2:
				case 6:
					sdt.SetTerminalActive(def.StateSettings.LockedStateSetting.AccessibleWhenUnlocked);
					break;
				case 5:
				case 7:
				case 8:
				case 9:
				case 10:
				case 11:
					break;
				}
			});
			switch (def.StateSettings.OverrideCommandAccessibility)
			{
			case OverrideCmdAccess.ALWAYS:
				AddOverrideCommandWithAlarmText(sdt);
				break;
			case OverrideCmdAccess.ON_UNLOCK:
				sdt.LinkedDoor.m_sync.OnDoorStateChange += Action<pDoorState, bool>.op_Implicit((Action<pDoorState, bool>)delegate(pDoorState state, bool isDropin)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0007: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_0009: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					//IL_000c: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Invalid comparison between Unknown and I4
					//IL_0012: Unknown result type (might be due to invalid IL or missing references)
					//IL_0015: Invalid comparison between Unknown and I4
					eDoorStatus status2 = state.status;
					eDoorStatus val6 = status2;
					if (val6 - 4 <= 1 || (int)val6 == 9)
					{
						AddOverrideCommandWithAlarmText(sdt);
					}
				});
				break;
			}
			return sdt;
		}

		public override void Init()
		{
			base.Init();
		}

		private void BuildLevelSDTs_Instantiation()
		{
			if (!base.definitions.ContainsKey(RundownManager.ActiveExpedition.LevelLayoutData))
			{
				return;
			}
			foreach (SecurityDoorTerminalDefinition definition in base.definitions[RundownManager.ActiveExpedition.LevelLayoutData].Definitions)
			{
				SecDoorTerminal val = BuildSDT_Instantiation(definition);
				if (val != null)
				{
					levelSDTs.Add((val, definition));
				}
			}
		}

		private void OnLevelCleanup()
		{
			levelSDTs.Clear();
		}

		private SecurityDoorTerminalManager()
		{
			EOSWardenEventManager.Current.AddEventDefinition(SDTWardenEvents.ADD_OVERRIDE_COMMAND.ToString(), 1000u, (Action<WardenObjectiveEventData>)WardenEvent_AddOverrideCommand);
			BatchBuildManager.Current.Add_OnBatchDone((BatchName)75, (Action)BuildLevelSDTs_Instantiation);
			BatchBuildManager.Current.Add_OnBatchDone((BatchName)76, (Action)BuildLevelSDTs_Passwords);
			LevelAPI.OnBuildDone += BuildLevelSDTs_UniqueCommands;
			LevelAPI.OnLevelCleanup += OnLevelCleanup;
		}

		static SecurityDoorTerminalManager()
		{
			Current = new SecurityDoorTerminalManager();
		}
	}
}
namespace EOSExt.SecurityDoorTerminal.Definition
{
	public enum OverrideCmdAccess
	{
		ALWAYS,
		ON_UNLOCK,
		ADDED_BY_WARDEN_EVENT
	}
	public class SDTStateSetting_Locked
	{
		public bool AccessibleWhenLocked { get; set; } = false;


		public bool AccessibleWhenUnlocked { get; set; } = true;

	}
	public class SDTStateSetting
	{
		public SDTStateSetting_Locked LockedStateSetting { get; set; } = new SDTStateSetting_Locked();


		public OverrideCmdAccess OverrideCommandAccessibility { get; set; } = OverrideCmdAccess.ON_UNLOCK;


		public CPSolvedBehaviour OnPuzzleSolved { get; set; } = (CPSolvedBehaviour)1;

	}
	public class SecurityDoorTerminalDefinition : GlobalZoneIndex
	{
		public string FCDoorWorldEventObjectFilter { get; set; } = string.Empty;


		public SDTStateSetting StateSettings { get; set; } = new SDTStateSetting();


		public TerminalDefinition TerminalSettings { get; set; } = new TerminalDefinition();

	}
}