Decompiled source of ExtendedTransportManager v0.0.2

K45_XTM.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using Belzont.AssemblyUtility;
using Belzont.Interfaces;
using Belzont.Serialization;
using Belzont.Utils;
using BelzontTLM.Palettes;
using BepInEx;
using BepInEx.Logging;
using Colossal;
using Colossal.Collections;
using Colossal.Entities;
using Colossal.IO.AssetDatabase;
using Colossal.Localization;
using Colossal.Logging;
using Colossal.Mathematics;
using Colossal.OdinSerializer.Utilities;
using Colossal.Serialization.Entities;
using Colossal.UI;
using Colossal.UI.Binding;
using Game;
using Game.Areas;
using Game.Buildings;
using Game.Common;
using Game.Creatures;
using Game.Economy;
using Game.Modding;
using Game.Net;
using Game.Notifications;
using Game.Objects;
using Game.Pathfind;
using Game.Prefabs;
using Game.Rendering;
using Game.Routes;
using Game.SceneFlow;
using Game.Settings;
using Game.Tools;
using Game.UI;
using Game.UI.InGame;
using Game.Vehicles;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MonoMod.Utils;
using Unity.Burst.Intrinsics;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
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(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: KlyteModCanonVersion("0.0.5.4", "0.0.2")]
[assembly: AssemblyCompany("K45_XTM")]
[assembly: AssemblyConfiguration("Thunderstore")]
[assembly: AssemblyFileVersion("0.0.2.65534")]
[assembly: AssemblyInformationalVersion("0.0.2.65534")]
[assembly: AssemblyProduct("K45_XTM")]
[assembly: AssemblyTitle("K45_XTM")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.2.65534")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsUnmanagedAttribute : Attribute
	{
	}
}
public class XTMModData : BasicModData
{
	public XTMModData(IMod mod)
		: base(mod)
	{
	}

	public override void OnSetDefaults()
	{
	}
}
namespace ExtendedTransportManager
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "K45_XTM";

		public const string PLUGIN_NAME = "K45_XTM";

		public const string PLUGIN_VERSION = "0.0.2.65534";
	}
}
namespace BelzontTLM
{
	[BepInPlugin("K45_XTM", "K45_XTM", "0.0.2.65534")]
	public class EUIBepinexPlugin : BaseUnityPlugin
	{
		public void Awake()
		{
			LogUtils.LogsEnabled = false;
			LogUtils.Logger = ((BaseUnityPlugin)this).Logger;
			LogUtils.DoInfoLog("STARTING MOD!");
			Redirector.PatchAll();
		}
	}
	public class ExtendedTransportManagerMod : BasicIMod, IMod
	{
		public new static ExtendedTransportManagerMod Instance => (ExtendedTransportManagerMod)BasicIMod.Instance;

		public override string SimpleName => "Extended Transport Manager";

		public override string SafeName => "ExtendedTransportManager";

		public override string Acronym => "XTM";

		public override string Description => "!!!";

		public string PalettesFolder => Path.Combine(BasicIMod.ModSettingsRootFolder, "Palettes");

		public override void DoOnCreateWorld(UpdateSystem updateSystem)
		{
			updateSystem.UpdateBefore<XTMRouteAutoColorSystem>((SystemUpdatePhase)22);
			updateSystem.UpdateBefore<XTMStopsLinkingSystem>((SystemUpdatePhase)22);
			updateSystem.UpdateAt<XTMLineViewerSystem>((SystemUpdatePhase)22);
			updateSystem.UpdateAt<XTMLineManagementSystem>((SystemUpdatePhase)22);
			updateSystem.UpdateAfter<XTMLineViewerSection>((SystemUpdatePhase)22);
			updateSystem.UpdateAfter<XTMLineListingSection>((SystemUpdatePhase)22);
		}

		public override void OnDispose()
		{
		}

		public override void DoOnLoad()
		{
		}

		public override BasicModData CreateSettingsFile()
		{
			return new XTMModData((IMod)(object)this);
		}
	}
	[CompilerGenerated]
	public abstract class BelzontQueueSystem<T> : SystemBase
	{
		private UIUpdateState m_UpdateState;

		protected readonly Queue<KeyValuePair<Entity, (bool, Action<T>)>> itemsToProcess = new Queue<KeyValuePair<Entity, (bool, Action<T>)>>();

		protected readonly Dictionary<Entity, Action<T>> awaitingQueue = new Dictionary<Entity, Action<T>>();

		protected virtual ComponentType[] ComponentsToCheck => (ComponentType[])(object)new ComponentType[2]
		{
			ComponentType.op_Implicit(typeof(Updated)),
			ComponentType.op_Implicit(typeof(BatchesUpdated))
		};

		public void Enqueue(Entity e, Action<T> onEnd, bool force = false)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			LogUtils.DoLog("{0}: E = {1}, Force = {2}", ((object)this).GetType(), e, force);
			itemsToProcess.Enqueue(new KeyValuePair<Entity, (bool, Action<T>)>(e, (force, onEnd)));
		}

		protected override void OnCreate()
		{
			((ComponentSystemBase)this).OnCreate();
			m_UpdateState = UIUpdateState.Create(((ComponentSystemBase)this).World, 256);
		}

		protected abstract void Reset();

		protected abstract T OnProcess(Entity e);

		protected virtual void OnPreUpdate()
		{
		}

		protected virtual bool ForceUpdate()
		{
			return false;
		}

		protected abstract void RunUpdate(Entity e);

		protected sealed override void OnUpdate()
		{
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: 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_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			OnPreUpdate();
			if (m_UpdateState.Advance() || ForceUpdate())
			{
				LogUtils.DoLog("{0}: ADVANCE/FORCE UNQUEUE!", ((object)this).GetType());
				foreach (KeyValuePair<Entity, Action<T>> item in awaitingQueue)
				{
					itemsToProcess.Enqueue(new KeyValuePair<Entity, (bool, Action<T>)>(item.Key, (true, item.Value)));
				}
				awaitingQueue.Clear();
			}
			if (ComponentsToCheck.Length != 0)
			{
				KeyValuePair<Entity, Action<T>>[] array = awaitingQueue.Where((KeyValuePair<Entity, Action<T>> x) => ComponentsToCheck.Any(delegate(ComponentType t)
				{
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_000b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0014: Unknown result type (might be due to invalid IL or missing references)
					//IL_0019: Unknown result type (might be due to invalid IL or missing references)
					EntityManager entityManager2 = ((ComponentSystemBase)this).EntityManager;
					return ((EntityManager)(ref entityManager2)).HasComponent(x.Key, t);
				})).ToArray();
				for (int i = 0; i < array.Length; i++)
				{
					KeyValuePair<Entity, Action<T>> entry = array[i];
					if (BasicIMod.DebugMode)
					{
						LogUtils.DoLog("{0}: COMPONENT FOUND! {1}", ((object)this).GetType(), entry.Key, ComponentsToCheck.First(delegate(ComponentType x)
						{
							//IL_0006: Unknown result type (might be due to invalid IL or missing references)
							//IL_000b: Unknown result type (might be due to invalid IL or missing references)
							//IL_0014: Unknown result type (might be due to invalid IL or missing references)
							//IL_0019: Unknown result type (might be due to invalid IL or missing references)
							EntityManager entityManager = ((ComponentSystemBase)this).EntityManager;
							return ((EntityManager)(ref entityManager)).HasComponent(entry.Key, x);
						}));
					}
					itemsToProcess.Enqueue(new KeyValuePair<Entity, (bool, Action<T>)>(entry.Key, (true, entry.Value)));
					awaitingQueue.Remove(entry.Key);
				}
			}
			if (itemsToProcess.Count > 0)
			{
				KeyValuePair<Entity, (bool, Action<T>)> keyValuePair = itemsToProcess.Dequeue();
				if (keyValuePair.Value.Item1)
				{
					Reset();
					RunUpdate(keyValuePair.Key);
					keyValuePair.Value.Item2(OnProcess(keyValuePair.Key));
				}
				else
				{
					awaitingQueue[keyValuePair.Key] = keyValuePair.Value.Item2;
				}
			}
		}

		protected bool TryGetComponentWithUpgrades<X>(Entity entity, Entity prefab, out X data) where X : unmanaged, IComponentData, ICombineData<X>
		{
			//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_0007: Unknown result type (might be due to invalid IL or missing references)
			return UpgradeUtils.TryGetCombinedComponent<X>(((ComponentSystemBase)this).EntityManager, entity, prefab, ref data);
		}
	}
	public class XTMLineViewerSection : BelzontQueueSystem<XTMLineViewerSection.XTMLineViewerResult>
	{
		private struct LineRequirementsCheckJob : IJob
		{
			[ReadOnly]
			public Entity m_SelectedEntity;

			[ReadOnly]
			public Entity m_SelectedRouteEntity;

			[ReadOnly]
			public ComponentLookup<Route> m_Routes;

			[ReadOnly]
			public ComponentLookup<TransportLine> m_TransportLines;

			[ReadOnly]
			public ComponentLookup<TransportStop> m_TransportStops;

			[ReadOnly]
			public ComponentLookup<TaxiStand> m_TaxiStands;

			[ReadOnly]
			public ComponentLookup<Vehicle> m_Vehicles;

			[ReadOnly]
			public ComponentLookup<Owner> m_Owners;

			[ReadOnly]
			public ComponentLookup<PublicTransport> m_PublicTransports;

			[ReadOnly]
			public ComponentLookup<CurrentRoute> m_CurrentRoutes;

			[ReadOnly]
			public BufferLookup<RouteWaypoint> m_RouteWaypointBuffers;

			[ReadOnly]
			public BufferLookup<RouteSegment> m_RouteSegmentBuffers;

			[ReadOnly]
			public BufferLookup<RouteVehicle> m_RouteVehicleBuffers;

			[ReadOnly]
			public BufferLookup<ConnectedRoute> m_ConnectedRouteBuffers;

			[ReadOnly]
			public BufferLookup<SubObject> m_SubObjectBuffers;

			[ReadOnly]
			public BufferLookup<InstalledUpgrade> m_InstalledUpgradeBuffers;

			public NativeArray<bool> m_BoolResult;

			public NativeArray<Entity> m_EntityResult;

			public void Execute()
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: 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_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: 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_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
				if (IsLine(m_SelectedEntity))
				{
					m_BoolResult[0] = true;
					m_BoolResult[1] = true;
					m_EntityResult[0] = m_SelectedEntity;
					return;
				}
				NativeList<ConnectedRoute> connectedRoutes = default(NativeList<ConnectedRoute>);
				connectedRoutes..ctor(10, AllocatorHandle.op_Implicit((Allocator)2));
				bool flag = TryGetStationRoutes(m_SelectedEntity, connectedRoutes);
				bool flag2 = TryGetStopRoutes(m_SelectedEntity, connectedRoutes);
				Entity routeEntity;
				if (flag || flag2)
				{
					bool flag3 = false;
					Entity val = Entity.Null;
					Owner val2 = default(Owner);
					for (int num = connectedRoutes.Length - 1; num >= 0; num--)
					{
						if (m_Owners.TryGetComponent(connectedRoutes[num].m_Waypoint, ref val2) && IsLine(val2.m_Owner))
						{
							val = val2.m_Owner;
							if (val == m_SelectedRouteEntity)
							{
								flag3 = true;
							}
						}
					}
					if (!flag3)
					{
						m_BoolResult[0] = true;
						m_BoolResult[1] = true;
						m_EntityResult[0] = val;
					}
					else
					{
						m_BoolResult[0] = true;
						m_BoolResult[1] = false;
						m_EntityResult[0] = Entity.Null;
					}
				}
				else if (IsVehicle(out routeEntity))
				{
					m_BoolResult[0] = true;
					m_BoolResult[1] = true;
					m_EntityResult[0] = routeEntity;
				}
				else
				{
					m_BoolResult[0] = false;
					m_BoolResult[1] = false;
					m_EntityResult[0] = Entity.Null;
				}
			}

			private bool IsLine(Entity entity)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				return m_Routes.HasComponent(entity) && m_TransportLines.HasComponent(entity) && m_RouteWaypointBuffers.HasBuffer(entity) && m_RouteSegmentBuffers.HasBuffer(entity) && m_RouteVehicleBuffers.HasBuffer(entity);
			}

			private bool TryGetStationRoutes(Entity entity, NativeList<ConnectedRoute> connectedRoutes)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: 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_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				DynamicBuffer<SubObject> val = default(DynamicBuffer<SubObject>);
				if (m_SubObjectBuffers.TryGetBuffer(entity, ref val))
				{
					for (int i = 0; i < val.Length; i++)
					{
						TryGetStopRoutes(val[i].m_SubObject, connectedRoutes);
					}
				}
				DynamicBuffer<InstalledUpgrade> val2 = default(DynamicBuffer<InstalledUpgrade>);
				if (m_InstalledUpgradeBuffers.TryGetBuffer(entity, ref val2))
				{
					Enumerator<InstalledUpgrade> enumerator = val2.GetEnumerator();
					try
					{
						while (enumerator.MoveNext())
						{
							InstalledUpgrade current = enumerator.Current;
							TryGetStationRoutes(current.m_Upgrade, connectedRoutes);
						}
					}
					finally
					{
						((IDisposable)enumerator).Dispose();
					}
				}
				return connectedRoutes.Length > 0;
			}

			private bool TryGetStopRoutes(Entity entity, NativeList<ConnectedRoute> connectedRoutes)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: 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_0043: Unknown result type (might be due to invalid IL or missing references)
				DynamicBuffer<ConnectedRoute> val = default(DynamicBuffer<ConnectedRoute>);
				if (m_ConnectedRouteBuffers.TryGetBuffer(entity, ref val) && m_TransportStops.HasComponent(entity) && !m_TaxiStands.HasComponent(entity) && val.Length > 0)
				{
					connectedRoutes.AddRange(val.AsNativeArray());
					return true;
				}
				return false;
			}

			private bool IsVehicle(out Entity routeEntity)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: 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_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: 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_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				CurrentRoute val = default(CurrentRoute);
				if (m_Vehicles.HasComponent(m_SelectedEntity) && m_Owners.HasComponent(m_SelectedEntity) && m_PublicTransports.HasComponent(m_SelectedEntity) && m_CurrentRoutes.TryGetComponent(m_SelectedEntity, ref val) && IsLine(val.m_Route))
				{
					routeEntity = val.m_Route;
					return true;
				}
				routeEntity = Entity.Null;
				return false;
			}
		}

		private struct TypeHandle
		{
			[ReadOnly]
			public ComponentLookup<Route> __Game_Routes_Route_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TransportLine> __Game_Routes_TransportLine_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TransportStop> __Game_Routes_TransportStop_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TaxiStand> __Game_Routes_TaxiStand_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Vehicle> __Game_Vehicles_Vehicle_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Owner> __Game_Common_Owner_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<PublicTransport> __Game_Vehicles_PublicTransport_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<CurrentRoute> __Game_Routes_CurrentRoute_RO_ComponentLookup;

			[ReadOnly]
			public BufferLookup<RouteWaypoint> __Game_Routes_RouteWaypoint_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<RouteSegment> __Game_Routes_RouteSegment_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<RouteVehicle> __Game_Routes_RouteVehicle_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<ConnectedRoute> __Game_Routes_ConnectedRoute_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<SubObject> __Game_Objects_SubObject_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<InstalledUpgrade> __Game_Buildings_InstalledUpgrade_RO_BufferLookup;

			[ReadOnly]
			public ComponentLookup<Color> __Game_Routes_Color_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<PathInformation> __Game_Pathfind_PathInformation_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Connected> __Game_Routes_Connected_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<WaitingPassengers> __Game_Routes_WaitingPassengers_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Position> __Game_Routes_Position_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<RouteLane> __Game_Routes_RouteLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Target> __Game_Common_Target_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<PathOwner> __Game_Pathfind_PathOwner_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Waypoint> __Game_Routes_Waypoint_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Train> __Game_Vehicles_Train_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Curve> __Game_Net_Curve_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<MasterLane> __Game_Net_MasterLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<SlaveLane> __Game_Net_SlaveLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<CarCurrentLane> __Game_Vehicles_CarCurrentLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TrainCurrentLane> __Game_Vehicles_TrainCurrentLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<WatercraftCurrentLane> __Game_Vehicles_WatercraftCurrentLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<AircraftCurrentLane> __Game_Vehicles_AircraftCurrentLane_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Pet> __Game_Creatures_Pet_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<PrefabRef> __Game_Prefabs_PrefabRef_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TransportLineData> __Game_Prefabs_TransportLineData_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<TrainData> __Game_Prefabs_TrainData_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<PublicTransportVehicleData> __Game_Prefabs_PublicTransportVehicleData_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<CargoTransportVehicleData> __Game_Prefabs_CargoTransportVehicleData_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<CullingInfo> __Game_Rendering_CullingInfo_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<Transform> __Game_Objects_Transform_RO_ComponentLookup;

			[ReadOnly]
			public ComponentLookup<OutsideConnection> __Game_Objects_OutsideConnection_RO_ComponentLookup;

			[ReadOnly]
			public BufferLookup<Resources> __Game_Economy_Resources_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<LayoutElement> __Game_Vehicles_LayoutElement_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<CarNavigationLane> __Game_Vehicles_CarNavigationLane_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<TrainNavigationLane> __Game_Vehicles_TrainNavigationLane_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<WatercraftNavigationLane> __Game_Vehicles_WatercraftNavigationLane_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<AircraftNavigationLane> __Game_Vehicles_AircraftNavigationLane_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<PathElement> __Game_Pathfind_PathElement_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<SubLane> __Game_Net_SubLane_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<Passenger> __Game_Vehicles_Passenger_RO_BufferLookup;

			[ReadOnly]
			public BufferLookup<XTMChildConnectedRoute> __Game_Vehicles_XTMChildConnectedRoute_RO_BufferLookup;

			internal ComponentLookup<Building> __Game_Buildings_RO_ComponentLookup;

			internal BufferLookup<ConnectedBuilding> __Game_ConnectBuildingBuffers_RO_BufferLookup;

			internal ComponentLookup<Attached> __Game_Attacheds_RO_ComponentLookup;

			internal ComponentLookup<Edge> __Game_Edges_RO_ComponentLookup;

			internal BufferLookup<ConnectedEdge> __Game_ConnectEdge_RO_BufferLookup;

			internal ComponentLookup<Odometer> __Game_Odometers_RO_ComponentLookup;

			public void __AssignHandles(ref SystemState state)
			{
				//IL_0004: 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_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: 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_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: 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_007e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bf: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: 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)
				//IL_00ee: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_011a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0122: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_013c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_0149: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0156: Unknown result type (might be due to invalid IL or missing references)
				//IL_015b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				//IL_0168: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Unknown result type (might be due to invalid IL or missing references)
				//IL_017d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: 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_0197: Unknown result type (might be due to invalid IL or missing references)
				//IL_019c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f7: 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_0204: Unknown result type (might be due to invalid IL or missing references)
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0211: Unknown result type (might be due to invalid IL or missing references)
				//IL_0219: Unknown result type (might be due to invalid IL or missing references)
				//IL_021e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0226: Unknown result type (might be due to invalid IL or missing references)
				//IL_022b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0233: Unknown result type (might be due to invalid IL or missing references)
				//IL_0238: Unknown result type (might be due to invalid IL or missing references)
				//IL_0240: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: Unknown result type (might be due to invalid IL or missing references)
				//IL_024d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_025a: Unknown result type (might be due to invalid IL or missing references)
				//IL_025f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0267: Unknown result type (might be due to invalid IL or missing references)
				//IL_026c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_0279: Unknown result type (might be due to invalid IL or missing references)
				//IL_0281: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_028e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0293: Unknown result type (might be due to invalid IL or missing references)
				//IL_029b: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a8: 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_02b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
				__Game_Routes_Route_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Route>(true);
				__Game_Routes_TransportLine_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TransportLine>(true);
				__Game_Routes_TransportStop_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TransportStop>(true);
				__Game_Routes_TaxiStand_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TaxiStand>(true);
				__Game_Vehicles_Vehicle_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Vehicle>(true);
				__Game_Common_Owner_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Owner>(true);
				__Game_Vehicles_PublicTransport_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<PublicTransport>(true);
				__Game_Routes_CurrentRoute_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<CurrentRoute>(true);
				__Game_Routes_RouteWaypoint_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<RouteWaypoint>(true);
				__Game_Routes_RouteSegment_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<RouteSegment>(true);
				__Game_Routes_RouteVehicle_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<RouteVehicle>(true);
				__Game_Routes_ConnectedRoute_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<ConnectedRoute>(true);
				__Game_Objects_SubObject_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<SubObject>(true);
				__Game_Buildings_InstalledUpgrade_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<InstalledUpgrade>(true);
				__Game_Routes_Color_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Color>(true);
				__Game_Pathfind_PathInformation_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<PathInformation>(true);
				__Game_Routes_Connected_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Connected>(true);
				__Game_Routes_WaitingPassengers_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<WaitingPassengers>(true);
				__Game_Routes_Position_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Position>(true);
				__Game_Routes_RouteLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<RouteLane>(true);
				__Game_Common_Target_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Target>(true);
				__Game_Pathfind_PathOwner_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<PathOwner>(true);
				__Game_Routes_Waypoint_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Waypoint>(true);
				__Game_Vehicles_Train_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Train>(true);
				__Game_Net_Curve_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Curve>(true);
				__Game_Net_MasterLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<MasterLane>(true);
				__Game_Net_SlaveLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<SlaveLane>(true);
				__Game_Vehicles_CarCurrentLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<CarCurrentLane>(true);
				__Game_Vehicles_TrainCurrentLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TrainCurrentLane>(true);
				__Game_Vehicles_WatercraftCurrentLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<WatercraftCurrentLane>(true);
				__Game_Vehicles_AircraftCurrentLane_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<AircraftCurrentLane>(true);
				__Game_Creatures_Pet_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Pet>(true);
				__Game_Prefabs_PrefabRef_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<PrefabRef>(true);
				__Game_Prefabs_TransportLineData_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TransportLineData>(true);
				__Game_Prefabs_TrainData_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<TrainData>(true);
				__Game_Prefabs_PublicTransportVehicleData_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<PublicTransportVehicleData>(true);
				__Game_Prefabs_CargoTransportVehicleData_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<CargoTransportVehicleData>(true);
				__Game_Rendering_CullingInfo_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<CullingInfo>(true);
				__Game_Objects_Transform_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Transform>(true);
				__Game_Objects_OutsideConnection_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<OutsideConnection>(true);
				__Game_Economy_Resources_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<Resources>(true);
				__Game_Vehicles_LayoutElement_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<LayoutElement>(true);
				__Game_Vehicles_CarNavigationLane_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<CarNavigationLane>(true);
				__Game_Vehicles_TrainNavigationLane_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<TrainNavigationLane>(true);
				__Game_Vehicles_WatercraftNavigationLane_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<WatercraftNavigationLane>(true);
				__Game_Vehicles_AircraftNavigationLane_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<AircraftNavigationLane>(true);
				__Game_Pathfind_PathElement_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<PathElement>(true);
				__Game_Net_SubLane_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<SubLane>(true);
				__Game_Vehicles_Passenger_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<Passenger>(true);
				__Game_Vehicles_XTMChildConnectedRoute_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<XTMChildConnectedRoute>(true);
				__Game_Buildings_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Building>(true);
				__Game_Odometers_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Odometer>(true);
				__Game_Attacheds_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Attached>(true);
				__Game_Edges_RO_ComponentLookup = ((SystemState)(ref state)).GetComponentLookup<Edge>(true);
				__Game_ConnectBuildingBuffers_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<ConnectedBuilding>(true);
				__Game_ConnectEdge_RO_BufferLookup = ((SystemState)(ref state)).GetBufferLookup<ConnectedEdge>(true);
			}
		}

		private struct UpdateJob : IJob
		{
			[ReadOnly]
			public Entity m_RouteEntity;

			[ReadOnly]
			public ComponentLookup<Color> m_Colors;

			[ReadOnly]
			public ComponentLookup<PathInformation> m_PathInformation;

			[ReadOnly]
			public ComponentLookup<Connected> m_Connected;

			[ReadOnly]
			public ComponentLookup<WaitingPassengers> m_WaitingPassengers;

			[ReadOnly]
			public ComponentLookup<Position> m_Positions;

			[ReadOnly]
			public ComponentLookup<RouteLane> m_RouteLanes;

			[ReadOnly]
			public ComponentLookup<CurrentRoute> m_CurrentRoutes;

			[ReadOnly]
			public ComponentLookup<Target> m_Targets;

			[ReadOnly]
			public ComponentLookup<PathOwner> m_PathOwners;

			[ReadOnly]
			public ComponentLookup<Owner> m_Owners;

			[ReadOnly]
			public ComponentLookup<Waypoint> m_Waypoints;

			[ReadOnly]
			public ComponentLookup<Train> m_Trains;

			[ReadOnly]
			public ComponentLookup<Curve> m_Curves;

			[ReadOnly]
			public ComponentLookup<MasterLane> m_MasterLanes;

			[ReadOnly]
			public ComponentLookup<SlaveLane> m_SlaveLanes;

			[ReadOnly]
			public ComponentLookup<CarCurrentLane> m_CarCurrentLanes;

			[ReadOnly]
			public ComponentLookup<TrainCurrentLane> m_TrainCurrentLanes;

			[ReadOnly]
			public ComponentLookup<WatercraftCurrentLane> m_WatercraftCurrentLanes;

			[ReadOnly]
			public ComponentLookup<AircraftCurrentLane> m_AircraftCurrentLanes;

			[ReadOnly]
			public ComponentLookup<Pet> m_Pets;

			[ReadOnly]
			public ComponentLookup<PrefabRef> m_PrefabRefs;

			[ReadOnly]
			public ComponentLookup<TransportLineData> m_TransportLineData;

			[ReadOnly]
			public ComponentLookup<TrainData> m_TrainDatas;

			[ReadOnly]
			public ComponentLookup<PublicTransportVehicleData> m_PublicTransportVehicleDatas;

			[ReadOnly]
			public ComponentLookup<CargoTransportVehicleData> m_CargoTransportVehicleDatas;

			[ReadOnly]
			public ComponentLookup<TransportStop> m_TransportStops;

			[ReadOnly]
			public ComponentLookup<CullingInfo> m_CullingInfos;

			[ReadOnly]
			public ComponentLookup<Transform> m_Transforms;

			[ReadOnly]
			public ComponentLookup<OutsideConnection> m_OutsideConnections;

			[ReadOnly]
			public BufferLookup<Resources> m_EconomyResourcesBuffers;

			[ReadOnly]
			public BufferLookup<RouteWaypoint> m_RouteWaypointBuffers;

			[ReadOnly]
			public BufferLookup<RouteSegment> m_RouteSegmentBuffers;

			[ReadOnly]
			public BufferLookup<RouteVehicle> m_RouteVehicleBuffers;

			[ReadOnly]
			public BufferLookup<LayoutElement> m_LayoutElementBuffers;

			[ReadOnly]
			public BufferLookup<CarNavigationLane> m_CarNavigationLaneBuffers;

			[ReadOnly]
			public BufferLookup<TrainNavigationLane> m_TrainNavigationLaneBuffers;

			[ReadOnly]
			public BufferLookup<WatercraftNavigationLane> m_WatercraftNavigationLaneBuffers;

			[ReadOnly]
			public BufferLookup<AircraftNavigationLane> m_AircraftNavigationLaneBuffers;

			[ReadOnly]
			public BufferLookup<PathElement> m_PathElementBuffers;

			[ReadOnly]
			public BufferLookup<SubLane> m_SubLaneBuffers;

			[ReadOnly]
			public BufferLookup<XTMChildConnectedRoute> m_XTMConnectedRouteBuffers;

			[ReadOnly]
			public ComponentLookup<Odometer> m_Odometers;

			[ReadOnly]
			public ComponentLookup<Building> m_Buildings;

			[ReadOnly]
			public ComponentLookup<Attached> m_Attacheds;

			[ReadOnly]
			public ComponentLookup<Edge> m_Edges;

			[ReadOnly]
			public BufferLookup<ConnectedEdge> m_connectedEdgesBuffers;

			[ReadOnly]
			public BufferLookup<ConnectedBuilding> m_ConnectBuildingBuffers;

			[ReadOnly]
			public BufferLookup<ConnectedRoute> m_ConnectedRouteBuffers;

			[ReadOnly]
			public BufferLookup<Passenger> m_PassengerBuffers;

			public NativeList<LineSegment> m_SegmentsResult;

			public NativeList<LineStop> m_StopsResult;

			public NativeList<LineVehicle> m_VehiclesResult;

			public NativeArray<int> m_StopCapacityResult;

			public NativeArray<bool> m_BoolResult;

			public void Execute()
			{
				//IL_0004: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//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_0065: 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_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0187: Unknown result type (might be due to invalid IL or missing references)
				//IL_019b: 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_01ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f5: 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_031b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0320: Unknown result type (might be due to invalid IL or missing references)
				//IL_0334: Unknown result type (might be due to invalid IL or missing references)
				//IL_0336: 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_0273: Unknown result type (might be due to invalid IL or missing references)
				//IL_0275: Unknown result type (might be due to invalid IL or missing references)
				//IL_027a: Unknown result type (might be due to invalid IL or missing references)
				//IL_027e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_0288: Unknown result type (might be due to invalid IL or missing references)
				//IL_028d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0292: Unknown result type (might be due to invalid IL or missing references)
				//IL_0294: Unknown result type (might be due to invalid IL or missing references)
				//IL_0299: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_035d: Unknown result type (might be due to invalid IL or missing references)
				//IL_035f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0364: Unknown result type (might be due to invalid IL or missing references)
				//IL_036c: Unknown result type (might be due to invalid IL or missing references)
				//IL_036e: Unknown result type (might be due to invalid IL or missing references)
				//IL_038a: Unknown result type (might be due to invalid IL or missing references)
				//IL_038f: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_045b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0468: Unknown result type (might be due to invalid IL or missing references)
				//IL_0476: Unknown result type (might be due to invalid IL or missing references)
				//IL_040d: Unknown result type (might be due to invalid IL or missing references)
				//IL_040f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0613: Unknown result type (might be due to invalid IL or missing references)
				//IL_0615: Unknown result type (might be due to invalid IL or missing references)
				//IL_048d: Unknown result type (might be due to invalid IL or missing references)
				//IL_048f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0494: Unknown result type (might be due to invalid IL or missing references)
				//IL_0499: Unknown result type (might be due to invalid IL or missing references)
				//IL_049e: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0625: Unknown result type (might be due to invalid IL or missing references)
				//IL_0627: Unknown result type (might be due to invalid IL or missing references)
				//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_079a: Unknown result type (might be due to invalid IL or missing references)
				//IL_079c: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_07be: Unknown result type (might be due to invalid IL or missing references)
				//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
				//IL_0643: Unknown result type (might be due to invalid IL or missing references)
				//IL_0645: Unknown result type (might be due to invalid IL or missing references)
				//IL_0653: Unknown result type (might be due to invalid IL or missing references)
				//IL_0655: Unknown result type (might be due to invalid IL or missing references)
				//IL_065a: Unknown result type (might be due to invalid IL or missing references)
				//IL_065f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0661: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_0431: Unknown result type (might be due to invalid IL or missing references)
				//IL_0673: Unknown result type (might be due to invalid IL or missing references)
				//IL_0675: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_050e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0694: Unknown result type (might be due to invalid IL or missing references)
				//IL_0696: Unknown result type (might be due to invalid IL or missing references)
				//IL_052a: Unknown result type (might be due to invalid IL or missing references)
				//IL_052c: Unknown result type (might be due to invalid IL or missing references)
				//IL_070e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0710: Unknown result type (might be due to invalid IL or missing references)
				//IL_059a: Unknown result type (might be due to invalid IL or missing references)
				//IL_059c: Unknown result type (might be due to invalid IL or missing references)
				//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_054b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0550: Unknown result type (might be due to invalid IL or missing references)
				//IL_072f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0734: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_056a: Unknown result type (might be due to invalid IL or missing references)
				//IL_056f: Unknown result type (might be due to invalid IL or missing references)
				//IL_074c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0751: Unknown result type (might be due to invalid IL or missing references)
				//IL_0756: Unknown result type (might be due to invalid IL or missing references)
				//IL_075b: Unknown result type (might be due to invalid IL or missing references)
				//IL_075d: Unknown result type (might be due to invalid IL or missing references)
				//IL_05da: Unknown result type (might be due to invalid IL or missing references)
				//IL_05df: Unknown result type (might be due to invalid IL or missing references)
				NativeList<float> val = default(NativeList<float>);
				val..ctor(AllocatorHandle.op_Implicit((Allocator)2));
				float num = 0f;
				m_BoolResult[2] = false;
				m_StopCapacityResult[0] = 0;
				DynamicBuffer<RouteWaypoint> waypoints = m_RouteWaypointBuffers[m_RouteEntity];
				DynamicBuffer<RouteSegment> routeSegments = m_RouteSegmentBuffers[m_RouteEntity];
				DynamicBuffer<RouteVehicle> val2 = m_RouteVehicleBuffers[m_RouteEntity];
				for (int i = 0; i < routeSegments.Length; i++)
				{
					val.Add(ref num);
					num += GetSegmentLength(waypoints, routeSegments, i);
				}
				if (num == 0f)
				{
					return;
				}
				PathInformation val3 = default(PathInformation);
				for (int j = 0; j < routeSegments.Length; j++)
				{
					if (m_PathInformation.TryGetComponent(routeSegments[j].m_Segment, ref val3))
					{
						float start = val[j] / num;
						float end = ((j < routeSegments.Length - 1) ? (val[j + 1] / num) : 1f);
						bool broken = val3.m_Origin == Entity.Null && val3.m_Destination == Entity.Null;
						float distance = val3.m_Distance;
						LineSegment lineSegment = new LineSegment(start, end, broken, distance, val3.m_Duration);
						m_SegmentsResult.Add(ref lineSegment);
					}
				}
				PrefabRef val4 = default(PrefabRef);
				TransportLineData val5 = default(TransportLineData);
				bool flag = m_PrefabRefs.TryGetComponent(m_RouteEntity, ref val4) && m_TransportLineData.TryGetComponent(val4.m_Prefab, ref val5) && val5.m_CargoTransport;
				for (int k = 0; k < val2.Length; k++)
				{
					Entity vehicle = val2[k].m_Vehicle;
					if (GetVehiclePosition(m_RouteEntity, vehicle, out var prevWaypointIndex, out var distanceFromWaypoint, out var distanceToWaypoint, out var unknownPath))
					{
						int num2 = prevWaypointIndex;
						float segmentLength = GetSegmentLength(waypoints, routeSegments, num2);
						float num3 = val[num2];
						num3 = ((!unknownPath && !(distanceFromWaypoint + distanceToWaypoint > segmentLength)) ? (num3 + (segmentLength - distanceToWaypoint)) : (num3 + segmentLength * distanceFromWaypoint / math.max(1f, distanceFromWaypoint + distanceToWaypoint)));
						(int, int) cargo = GetCargo(vehicle);
						int item = cargo.Item1;
						int item2 = cargo.Item2;
						float position = num3 / num;
						Transform val6 = m_Transforms[vehicle];
						LineVehicle lineVehicle = new LineVehicle(vehicle, position, item, item2, float3.op_Implicit(val6.m_Position), quaternion.op_Implicit(val6.m_Rotation), m_Odometers[vehicle].m_Distance, flag);
						m_VehiclesResult.Add(ref lineVehicle);
						if (item2 > m_StopCapacityResult[0])
						{
							m_StopCapacityResult[0] = item2;
						}
					}
				}
				Connected val7 = default(Connected);
				Owner val8 = default(Owner);
				WaitingPassengers val9 = default(WaitingPassengers);
				DynamicBuffer<Resources> val10 = default(DynamicBuffer<Resources>);
				DynamicBuffer<Resources> val11 = default(DynamicBuffer<Resources>);
				NativeHashSet<Entity> val12 = default(NativeHashSet<Entity>);
				NativeQueue<Entity> val13 = default(NativeQueue<Entity>);
				NativeHashSet<LineStopConnnection> linesConnected = default(NativeHashSet<LineStopConnnection>);
				Building val14 = default(Building);
				Entity val15 = default(Entity);
				Edge val16 = default(Edge);
				DynamicBuffer<ConnectedEdge> val17 = default(DynamicBuffer<ConnectedEdge>);
				DynamicBuffer<ConnectedEdge> val18 = default(DynamicBuffer<ConnectedEdge>);
				Attached val19 = default(Attached);
				Edge val20 = default(Edge);
				DynamicBuffer<ConnectedEdge> val21 = default(DynamicBuffer<ConnectedEdge>);
				DynamicBuffer<ConnectedEdge> val22 = default(DynamicBuffer<ConnectedEdge>);
				for (int l = 0; l < waypoints.Length; l++)
				{
					if (!m_Connected.TryGetComponent(waypoints[l].m_Waypoint, ref val7) || !m_TransportStops.HasComponent(val7.m_Connected))
					{
						continue;
					}
					float position2 = val[l] / num;
					int num4 = 0;
					Entity connected = val7.m_Connected;
					bool flag2 = m_Owners.TryGetComponent(val7.m_Connected, ref val8);
					if (!flag && m_WaitingPassengers.TryGetComponent(waypoints[l].m_Waypoint, ref val9))
					{
						num4 = val9.m_Count;
					}
					else if (m_EconomyResourcesBuffers.TryGetBuffer(val7.m_Connected, ref val10))
					{
						for (int m = 0; m < val10.Length; m++)
						{
							num4 += val10[m].m_Amount;
						}
					}
					else if (flag2 && m_EconomyResourcesBuffers.TryGetBuffer(val8.m_Owner, ref val11))
					{
						for (int n = 0; n < val11.Length; n++)
						{
							num4 += val11[n].m_Amount;
						}
					}
					val12..ctor(0, AllocatorHandle.op_Implicit((Allocator)2));
					val13..ctor(AllocatorHandle.op_Implicit((Allocator)2));
					linesConnected..ctor(0, AllocatorHandle.op_Implicit((Allocator)4));
					if (flag2)
					{
						Entity owner = GetRealOwner(val8).m_Owner;
						AddLinesFromXTMConnections(ref linesConnected, owner, val7.m_Connected);
						if (m_Buildings.TryGetComponent(owner, ref val14))
						{
							val13.Enqueue(val14.m_RoadEdge);
							while (val13.TryDequeue(ref val15))
							{
								if (!val12.Add(val15) || !ScanLinesAtRoadEdge(ref linesConnected, val15, owner, val7.m_Connected) || !m_Edges.TryGetComponent(val15, ref val16))
								{
									continue;
								}
								if (m_connectedEdgesBuffers.TryGetBuffer(val16.m_Start, ref val17))
								{
									for (int num5 = 0; num5 < val17.Length; num5++)
									{
										if (!val12.Contains(val17[num5].m_Edge))
										{
											val13.Enqueue(val17[num5].m_Edge);
										}
									}
								}
								if (!m_connectedEdgesBuffers.TryGetBuffer(val16.m_End, ref val18))
								{
									continue;
								}
								for (int num6 = 0; num6 < val18.Length; num6++)
								{
									if (!val12.Contains(val18[num6].m_Edge))
									{
										val13.Enqueue(val18[num6].m_Edge);
									}
								}
							}
						}
					}
					if (m_Attacheds.TryGetComponent(val7.m_Connected, ref val19) && !val12.Contains(val19.m_Parent))
					{
						val12.Add(val19.m_Parent);
						if (ScanLinesAtRoadEdge(ref linesConnected, val19.m_Parent, Entity.Null, val7.m_Connected) && m_Edges.TryGetComponent(val19.m_Parent, ref val20))
						{
							if (m_connectedEdgesBuffers.TryGetBuffer(val20.m_Start, ref val21))
							{
								for (int num7 = 0; num7 < val21.Length; num7++)
								{
									if (val12.Add(val21[num7].m_Edge))
									{
										ScanLinesAtRoadEdge(ref linesConnected, val21[num7].m_Edge, Entity.Null, val7.m_Connected);
									}
								}
							}
							if (m_connectedEdgesBuffers.TryGetBuffer(val20.m_End, ref val22))
							{
								for (int num8 = 0; num8 < val22.Length; num8++)
								{
									if (val12.Add(val22[num8].m_Edge))
									{
										ScanLinesAtRoadEdge(ref linesConnected, val22[num8].m_Edge, Entity.Null, val7.m_Connected);
									}
								}
							}
						}
					}
					val12.Dispose();
					val13.Dispose();
					Transform val23 = m_Transforms[connected];
					LineStop lineStop = new LineStop(connected, position2, num4, flag, m_OutsideConnections.HasComponent(connected), linesConnected, float3.op_Implicit(val23.m_Position), quaternion.op_Implicit(val23.m_Rotation));
					m_StopsResult.Add(ref lineStop);
				}
				m_BoolResult[2] = flag;
			}

			private bool ScanLinesAtRoadEdge(ref NativeHashSet<LineStopConnnection> linesConnected, Entity road, Entity srcBuilding, Entity srcConnected)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				bool result = false;
				DynamicBuffer<ConnectedBuilding> val = default(DynamicBuffer<ConnectedBuilding>);
				if (m_ConnectBuildingBuffers.TryGetBuffer(road, ref val))
				{
					for (int i = 0; i < val.Length; i++)
					{
						if (val[i].m_Building != srcBuilding)
						{
							AddLinesFromXTMConnections(ref linesConnected, val[i].m_Building, srcConnected);
						}
						else
						{
							result = true;
						}
					}
				}
				AddLinesFromXTMConnections(ref linesConnected, road, srcConnected);
				return result;
			}

			private void AddLinesFromXTMConnections(ref NativeHashSet<LineStopConnnection> linesConnected, Entity xtmOwner, Entity srcConnected)
			{
				//IL_0007: 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_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: 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_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				DynamicBuffer<XTMChildConnectedRoute> val = default(DynamicBuffer<XTMChildConnectedRoute>);
				if (!m_XTMConnectedRouteBuffers.TryGetBuffer(xtmOwner, ref val))
				{
					return;
				}
				DynamicBuffer<ConnectedRoute> val2 = default(DynamicBuffer<ConnectedRoute>);
				Owner val3 = default(Owner);
				Connected val4 = default(Connected);
				for (int i = 0; i < val.Length; i++)
				{
					if (!m_ConnectedRouteBuffers.TryGetBuffer(val[i].m_StopEntity, ref val2))
					{
						continue;
					}
					for (int j = 0; j < val2.Length; j++)
					{
						if (m_Owners.TryGetComponent(val2[j].m_Waypoint, ref val3) && m_Connected.TryGetComponent(val2[j].m_Waypoint, ref val4) && (val3.m_Owner != m_RouteEntity || srcConnected != val4.m_Connected))
						{
							linesConnected.Add(new LineStopConnnection(val3.m_Owner, val4.m_Connected));
						}
					}
				}
			}

			private Owner GetRealOwner(Owner owner)
			{
				//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_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_0020: 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_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				Owner val = owner;
				Owner val2 = default(Owner);
				while (m_Owners.TryGetComponent(val.m_Owner, ref val2))
				{
					val = val2;
				}
				return val;
			}

			private float GetSegmentLength(DynamicBuffer<RouteWaypoint> waypoints, DynamicBuffer<RouteSegment> routeSegments, int segmentIndex)
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: 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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//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_0037: 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_0096: 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)
				PathInformation val = default(PathInformation);
				if (m_PathInformation.TryGetComponent(routeSegments[segmentIndex].m_Segment, ref val) && val.m_Destination != Entity.Null)
				{
					return val.m_Distance;
				}
				int num = math.select(segmentIndex + 1, 0, segmentIndex == waypoints.Length - 1);
				if (GetWaypointPosition(waypoints[segmentIndex].m_Waypoint, out var position, out var radius) && GetWaypointPosition(waypoints[num].m_Waypoint, out var position2, out var radius2))
				{
					return math.max(0f, math.distance(position, position2) - radius - radius2);
				}
				return 0f;
			}

			private bool GetWaypointPosition(Entity waypoint, out float3 position, out float radius)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				radius = 0f;
				Position val = default(Position);
				if (!m_Positions.TryGetComponent(waypoint, ref val))
				{
					position = default(float3);
					return false;
				}
				RouteLane val2 = default(RouteLane);
				Curve val3 = default(Curve);
				if (m_RouteLanes.TryGetComponent(waypoint, ref val2) && m_Curves.TryGetComponent(val2.m_EndLane, ref val3))
				{
					position = MathUtils.Position(val3.m_Bezier, val2.m_EndCurvePos);
					if (m_MasterLanes.HasComponent(val2.m_EndLane))
					{
						radius = math.distance(position, val.m_Position);
					}
					return true;
				}
				position = val.m_Position;
				return true;
			}

			private bool GetVehiclePosition(Entity transportRoute, Entity transportVehicle, out int prevWaypointIndex, out float distanceFromWaypoint, out float distanceToWaypoint, out bool unknownPath)
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_009e: 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_00c5: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: 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_00fb: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: 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_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_014f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Unknown result type (might be due to invalid IL or missing references)
				//IL_0242: Unknown result type (might be due to invalid IL or missing references)
				//IL_0244: 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_0167: 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_025a: Unknown result type (might be due to invalid IL or missing references)
				//IL_025c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0262: Unknown result type (might be due to invalid IL or missing references)
				//IL_0264: Invalid comparison between Unknown and I4
				//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02af: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0289: Unknown result type (might be due to invalid IL or missing references)
				//IL_028b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0272: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_032f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0334: Unknown result type (might be due to invalid IL or missing references)
				//IL_0359: Unknown result type (might be due to invalid IL or missing references)
				//IL_035b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0367: Unknown result type (might be due to invalid IL or missing references)
				//IL_0369: Unknown result type (might be due to invalid IL or missing references)
				//IL_036b: Unknown result type (might be due to invalid IL or missing references)
				//IL_036c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0376: Unknown result type (might be due to invalid IL or missing references)
				//IL_0378: Invalid comparison between Unknown and I4
				//IL_063e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0640: Unknown result type (might be due to invalid IL or missing references)
				//IL_038e: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0409: Unknown result type (might be due to invalid IL or missing references)
				//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_03df: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0475: Unknown result type (might be due to invalid IL or missing references)
				//IL_0440: Unknown result type (might be due to invalid IL or missing references)
				//IL_041e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0420: Unknown result type (might be due to invalid IL or missing references)
				//IL_042c: Unknown result type (might be due to invalid IL or missing references)
				//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0455: Unknown result type (might be due to invalid IL or missing references)
				//IL_0457: Unknown result type (might be due to invalid IL or missing references)
				//IL_0463: Unknown result type (might be due to invalid IL or missing references)
				//IL_052f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0589: Unknown result type (might be due to invalid IL or missing references)
				//IL_048e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0493: Unknown result type (might be due to invalid IL or missing references)
				//IL_049a: Unknown result type (might be due to invalid IL or missing references)
				//IL_049c: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0500: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0548: Unknown result type (might be due to invalid IL or missing references)
				//IL_054d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0554: Unknown result type (might be due to invalid IL or missing references)
				//IL_0556: Unknown result type (might be due to invalid IL or missing references)
				//IL_055b: Unknown result type (might be due to invalid IL or missing references)
				//IL_055d: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0604: Unknown result type (might be due to invalid IL or missing references)
				//IL_060b: Unknown result type (might be due to invalid IL or missing references)
				//IL_060d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0612: Unknown result type (might be due to invalid IL or missing references)
				//IL_0614: Unknown result type (might be due to invalid IL or missing references)
				prevWaypointIndex = 0;
				distanceFromWaypoint = 0f;
				distanceToWaypoint = 0f;
				unknownPath = true;
				CurrentRoute val = default(CurrentRoute);
				if (!m_CurrentRoutes.TryGetComponent(transportVehicle, ref val))
				{
					return false;
				}
				Target val2 = default(Target);
				if (!m_Targets.TryGetComponent(transportVehicle, ref val2))
				{
					return false;
				}
				PathOwner val3 = default(PathOwner);
				if (!m_PathOwners.TryGetComponent(transportVehicle, ref val3))
				{
					return false;
				}
				Waypoint val4 = default(Waypoint);
				if (!m_Waypoints.TryGetComponent(val2.m_Target, ref val4))
				{
					return false;
				}
				if (!GetWaypointPosition(val2.m_Target, out var position, out var radius))
				{
					return false;
				}
				DynamicBuffer<RouteWaypoint> val5 = default(DynamicBuffer<RouteWaypoint>);
				if (!m_RouteWaypointBuffers.TryGetBuffer(transportRoute, ref val5))
				{
					return false;
				}
				if (val.m_Route != transportRoute)
				{
					return false;
				}
				Entity val6 = transportVehicle;
				DynamicBuffer<LayoutElement> val7 = default(DynamicBuffer<LayoutElement>);
				PrefabRef val10 = default(PrefabRef);
				TrainData val11 = default(TrainData);
				if (m_LayoutElementBuffers.TryGetBuffer(transportVehicle, ref val7) && val7.Length != 0)
				{
					PrefabRef val8 = default(PrefabRef);
					TrainData val9 = default(TrainData);
					for (int i = 0; i < val7.Length; i++)
					{
						if (m_PrefabRefs.TryGetComponent(val7[i].m_Vehicle, ref val8) && m_TrainDatas.TryGetComponent(val8.m_Prefab, ref val9))
						{
							float num = math.csum(val9.m_AttachOffsets);
							distanceFromWaypoint -= num * 0.5f;
							distanceToWaypoint -= num * 0.5f;
						}
					}
					val6 = val7[0].m_Vehicle;
				}
				else if (m_PrefabRefs.TryGetComponent(transportVehicle, ref val10) && m_TrainDatas.TryGetComponent(val10.m_Prefab, ref val11))
				{
					float num2 = math.csum(val11.m_AttachOffsets);
					distanceFromWaypoint -= num2 * 0.5f;
					distanceToWaypoint -= num2 * 0.5f;
				}
				Train val12 = default(Train);
				PrefabRef val13 = default(PrefabRef);
				TrainData val14 = default(TrainData);
				if (m_Trains.TryGetComponent(val6, ref val12) && m_PrefabRefs.TryGetComponent(val6, ref val13) && m_TrainDatas.TryGetComponent(val13.m_Prefab, ref val14))
				{
					if ((val12.m_Flags & 1) > 0)
					{
						distanceToWaypoint -= val14.m_AttachOffsets.y;
					}
					else
					{
						distanceToWaypoint -= val14.m_AttachOffsets.x;
					}
				}
				CullingInfo val15 = default(CullingInfo);
				float3 val16;
				if (m_CullingInfos.TryGetComponent(val6, ref val15))
				{
					val16 = MathUtils.Center(val15.m_Bounds);
				}
				else
				{
					Transform val17 = default(Transform);
					if (!m_Transforms.TryGetComponent(val6, ref val17))
					{
						return false;
					}
					val16 = val17.m_Position;
				}
				prevWaypointIndex = math.select(val4.m_Index - 1, val5.Length - 1, val4.m_Index == 0);
				if (prevWaypointIndex >= val5.Length)
				{
					return false;
				}
				if (!GetWaypointPosition(val5[prevWaypointIndex].m_Waypoint, out var position2, out var radius2))
				{
					return false;
				}
				distanceFromWaypoint += math.distance(position2, val16) - radius2;
				float3 position3 = val16;
				if ((val3.m_State & 0x827) == 0)
				{
					unknownPath = false;
					CarCurrentLane val18 = default(CarCurrentLane);
					TrainCurrentLane val19 = default(TrainCurrentLane);
					WatercraftCurrentLane val20 = default(WatercraftCurrentLane);
					AircraftCurrentLane val21 = default(AircraftCurrentLane);
					if (m_CarCurrentLanes.TryGetComponent(val6, ref val18))
					{
						AddDistance(ref distanceToWaypoint, ref position3, val18.m_Lane, ((float3)(ref val18.m_CurvePosition)).xz);
					}
					else if (m_TrainCurrentLanes.TryGetComponent(val6, ref val19))
					{
						AddDistance(ref distanceToWaypoint, ref position3, val19.m_Front.m_Lane, ((float4)(ref val19.m_Front.m_CurvePosition)).yw);
					}
					else if (m_WatercraftCurrentLanes.TryGetComponent(val6, ref val20))
					{
						AddDistance(ref distanceToWaypoint, ref position3, val20.m_Lane, ((float3)(ref val20.m_CurvePosition)).xz);
					}
					else if (m_AircraftCurrentLanes.TryGetComponent(val6, ref val21))
					{
						AddDistance(ref distanceToWaypoint, ref position3, val21.m_Lane, ((float3)(ref val21.m_CurvePosition)).xz);
					}
					DynamicBuffer<CarNavigationLane> val22 = default(DynamicBuffer<CarNavigationLane>);
					DynamicBuffer<TrainNavigationLane> val24 = default(DynamicBuffer<TrainNavigationLane>);
					DynamicBuffer<WatercraftNavigationLane> val26 = default(DynamicBuffer<WatercraftNavigationLane>);
					DynamicBuffer<AircraftNavigationLane> val28 = default(DynamicBuffer<AircraftNavigationLane>);
					if (m_CarNavigationLaneBuffers.TryGetBuffer(transportVehicle, ref val22))
					{
						for (int j = 0; j < val22.Length; j++)
						{
							CarNavigationLane val23 = val22[j];
							AddDistance(ref distanceToWaypoint, ref position3, val23.m_Lane, val23.m_CurvePosition);
						}
					}
					else if (m_TrainNavigationLaneBuffers.TryGetBuffer(transportVehicle, ref val24))
					{
						for (int k = 0; k < val24.Length; k++)
						{
							TrainNavigationLane val25 = val24[k];
							AddDistance(ref distanceToWaypoint, ref position3, val25.m_Lane, val25.m_CurvePosition);
						}
					}
					else if (m_WatercraftNavigationLaneBuffers.TryGetBuffer(transportVehicle, ref val26))
					{
						for (int l = 0; l < val26.Length; l++)
						{
							WatercraftNavigationLane val27 = val26[l];
							AddDistance(ref distanceToWaypoint, ref position3, val27.m_Lane, val27.m_CurvePosition);
						}
					}
					else if (m_AircraftNavigationLaneBuffers.TryGetBuffer(transportVehicle, ref val28))
					{
						for (int m = 0; m < val28.Length; m++)
						{
							AircraftNavigationLane val29 = val28[m];
							AddDistance(ref distanceToWaypoint, ref position3, val29.m_Lane, val29.m_CurvePosition);
						}
					}
					DynamicBuffer<PathElement> val30 = default(DynamicBuffer<PathElement>);
					if (m_PathElementBuffers.TryGetBuffer(transportVehicle, ref val30))
					{
						for (int n = val3.m_ElementIndex; n < val30.Length; n++)
						{
							PathElement val31 = val30[n];
							AddDistance(ref distanceToWaypoint, ref position3, val31.m_Target, val31.m_TargetDelta);
						}
					}
				}
				distanceToWaypoint += math.distance(position3, position) - radius;
				distanceFromWaypoint = math.max(0f, distanceFromWaypoint);
				distanceToWaypoint = math.max(0f, distanceToWaypoint);
				return true;
			}

			private void AddDistance(ref float distance, ref float3 position, Entity lane, float2 curveDelta)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: 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_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: 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_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: 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_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: 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_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_010c: 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_0118: 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)
				SlaveLane val = default(SlaveLane);
				Owner val2 = default(Owner);
				DynamicBuffer<SubLane> val3 = default(DynamicBuffer<SubLane>);
				if (m_SlaveLanes.TryGetComponent(lane, ref val) && m_Owners.TryGetComponent(lane, ref val2) && m_SubLaneBuffers.TryGetBuffer(val2.m_Owner, ref val3) && val.m_MasterIndex < val3.Length)
				{
					lane = val3[(int)val.m_MasterIndex].m_SubLane;
				}
				Curve val4 = default(Curve);
				if (m_Curves.TryGetComponent(lane, ref val4))
				{
					distance += math.distance(position, MathUtils.Position(val4.m_Bezier, curveDelta.x));
					if ((curveDelta.x == 0f && curveDelta.y == 1f) || (curveDelta.x == 1f && curveDelta.y == 0f))
					{
						distance += val4.m_Length;
					}
					else
					{
						distance += MathUtils.Length(val4.m_Bezier, new Bounds1(curveDelta));
					}
					position = MathUtils.Position(val4.m_Bezier, curveDelta.y);
				}
			}

			private (int, int) GetCargo(Entity entity)
			{
				//IL_000b: 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_017d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0220: Unknown result type (might be due to invalid IL or missing references)
				//IL_0221: 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_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: 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_0234: Unknown result type (might be due to invalid IL or missing references)
				//IL_019c: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_025a: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f5: 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)
				//IL_0107: 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_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: 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_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Unknown result type (might be due to invalid IL or missing references)
				int num = 0;
				int num2 = 0;
				PrefabRef val = default(PrefabRef);
				if (m_PrefabRefs.TryGetComponent(entity, ref val))
				{
					DynamicBuffer<LayoutElement> val2 = default(DynamicBuffer<LayoutElement>);
					if (m_LayoutElementBuffers.TryGetBuffer(entity, ref val2))
					{
						DynamicBuffer<Passenger> val3 = default(DynamicBuffer<Passenger>);
						DynamicBuffer<Resources> val4 = default(DynamicBuffer<Resources>);
						PrefabRef val5 = default(PrefabRef);
						PublicTransportVehicleData val6 = default(PublicTransportVehicleData);
						CargoTransportVehicleData val7 = default(CargoTransportVehicleData);
						for (int i = 0; i < val2.Length; i++)
						{
							Entity vehicle = val2[i].m_Vehicle;
							if (m_PassengerBuffers.TryGetBuffer(vehicle, ref val3))
							{
								for (int j = 0; j < val3.Length; j++)
								{
									if (!m_Pets.HasComponent(val3[j].m_Passenger))
									{
										num++;
									}
								}
							}
							else if (m_EconomyResourcesBuffers.TryGetBuffer(vehicle, ref val4))
							{
								for (int k = 0; k < val4.Length; k++)
								{
									num += val4[k].m_Amount;
								}
							}
							if (m_PrefabRefs.TryGetComponent(vehicle, ref val5))
							{
								Entity prefab = val5.m_Prefab;
								if (m_PublicTransportVehicleDatas.TryGetComponent(prefab, ref val6))
								{
									num2 += val6.m_PassengerCapacity;
								}
								else if (m_CargoTransportVehicleDatas.TryGetComponent(prefab, ref val7))
								{
									num2 += val7.m_CargoCapacity;
								}
							}
						}
					}
					else
					{
						DynamicBuffer<Passenger> val8 = default(DynamicBuffer<Passenger>);
						DynamicBuffer<Resources> val9 = default(DynamicBuffer<Resources>);
						if (m_PassengerBuffers.TryGetBuffer(entity, ref val8))
						{
							for (int l = 0; l < val8.Length; l++)
							{
								if (!m_Pets.HasComponent(val8[l].m_Passenger))
								{
									num++;
								}
							}
						}
						else if (m_EconomyResourcesBuffers.TryGetBuffer(entity, ref val9))
						{
							for (int m = 0; m < val9.Length; m++)
							{
								num += val9[m].m_Amount;
							}
						}
						PublicTransportVehicleData val10 = default(PublicTransportVehicleData);
						CargoTransportVehicleData val11 = default(CargoTransportVehicleData);
						if (m_PublicTransportVehicleDatas.TryGetComponent(val.m_Prefab, ref val10))
						{
							num2 = val10.m_PassengerCapacity;
						}
						else if (m_CargoTransportVehicleDatas.TryGetComponent(val.m_Prefab, ref val11))
						{
							num2 += val11.m_CargoCapacity;
						}
					}
				}
				return (num, num2);
			}
		}

		public class XTMLineViewerResult
		{
			public XTMLineListingSection.LineItemStruct LineData { get; set; }

			public int StopCapacity { get; set; }

			public LineStopNamed[] Stops { get; set; }

			public LineVehicleNamed[] Vehicles { get; set; }

			public LineSegment[] Segments { get; set; }
		}

		public readonly struct LineStopConnnection : IEquatable<LineStopConnnection>
		{
			public Entity line { get; }

			public Entity stop { get; }

			public LineStopConnnection(Entity line, Entity stop)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: 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)
				this.line = line;
				this.stop = stop;
			}

			public bool Equals(LineStopConnnection other)
			{
				//IL_0002: 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_0016: 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)
				return line == other.line && stop == other.stop;
			}
		}

		public readonly struct LineStop
		{
			public Entity entity { get; }

			public float position { get; }

			public int cargo { get; }

			public bool isCargo { get; }

			public bool isOutsideConnection { get; }

			public NativeHashSet<LineStopConnnection> linesConnected { get; }

			public Vector3 worldPosition { get; }

			public Quaternion rotation { get; }

			public LineStop(Entity entity, float position, int cargo, bool isCargo, bool isOutsideConnection, NativeHashSet<LineStopConnnection> linesConnected, Vector3 worldPosition, Quaternion rotation)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				this.entity = entity;
				this.position = position;
				this.cargo = cargo;
				this.isCargo = isCargo;
				this.isOutsideConnection = isOutsideConnection;
				this.linesConnected = linesConnected;
				this.worldPosition = worldPosition;
				this.rotation = rotation;
			}
		}

		public readonly struct LineVehicle
		{
			internal float odometer { get; }

			public Entity entity { get; }

			public float position { get; }

			public int cargo { get; }

			public int capacity { get; }

			public bool isCargo { get; }

			public Vector3 worldPosition { get; }

			public Quaternion rotation { get; }

			public LineVehicle(Entity entity, float position, int cargo, int capacity, Vector3 worldPosition, Quaternion rotation, float odometer, bool isCargo = false)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)