using System;
using System.Collections.Generic;
using System.Linq;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x0200009A RID: 154
[Token(Token = "0x200009A")]
public class EnemiesManager
{
	// Token: 0x1700002D RID: 45
	// (get) Token: 0x060006D5 RID: 1749 RVA: 0x0001030C File Offset: 0x0000E50C
	[Token(Token = "0x1700002D")]
	public LockPointsManager LockPointsManager
	{
		[Token(Token = "0x60006D5")]
		[Address(RVA = "0x2B4380", Offset = "0x2B3180", VA = "0x1802B4380")]
		get;
	}

	// Token: 0x060006D6 RID: 1750 RVA: 0x00010320 File Offset: 0x0000E520
	[Token(Token = "0x60006D6")]
	[Address(RVA = "0xA652D0", Offset = "0xA640D0", VA = "0x180A652D0")]
	public void Init()
	{
		List<EnemiesManager.EnemyData> list = new List();
		this.enemies = list;
		this.<LockPointsManager>k__BackingField.Init();
		GameObject[] array = GameObject.FindGameObjectsWithTag("Enemy");
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			GameObject gameObject = array[num];
			this.AddEnemy(gameObject);
			num++;
		}
	}

	// Token: 0x060006D7 RID: 1751 RVA: 0x00010378 File Offset: 0x0000E578
	[Token(Token = "0x60006D7")]
	[Address(RVA = "0xA645D0", Offset = "0xA633D0", VA = "0x180A645D0")]
	public void AddEnemy(GameObject enemy)
	{
		int num = 0;
		if (!(enemy == num))
		{
			EnemiesManager.EnemyData enemyData = new EnemiesManager.EnemyData();
			NPCManage component = enemy.GetComponent<NPCManage>();
			enemyData.Npc = component;
			NPCManage npc = enemyData.Npc;
			int num2 = 0;
			if (npc == num2)
			{
				Debug.LogError("新增敵人NPCManage錯誤");
			}
			List<EnemiesManager.EnemyData> list = this.enemies;
			NPCManage npc2 = enemyData.Npc;
			int size = list._size;
			npc2.Init(size);
			NPCManage npc3 = enemyData.Npc;
			if (npc3.g_AILevel == NPCManage.AILevel.Monster)
			{
				Action<NPCManage> action = new Action(this.AddMonsterHPBar);
				npc3.hpBarHandler = action;
			}
			CharacterBaseData charData = enemyData.CharData;
			int num3 = 0;
			if (charData == num3)
			{
				Debug.LogError("新增敵人CharacterBaseData錯誤");
			}
			if (enemyData.Npc.g_LockPosition.Length != 0)
			{
				Transform posTipsPosition = enemyData.PosTipsPosition;
				int num4 = 0;
				if (posTipsPosition == num4)
				{
					Debug.LogError("新增敵人位置提示錯誤");
				}
			}
			this.enemies.Add(enemyData);
			NPCManage npc4 = enemyData.Npc;
			LockPointsManager lockPointsManager = this.<LockPointsManager>k__BackingField;
			LockPoint[] g_LockPosition = npc4.g_LockPosition;
			lockPointsManager.AddLockPoints(g_LockPosition);
			return;
		}
		Debug.LogError("新增敵人資料錯誤");
	}

	// Token: 0x060006D8 RID: 1752 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60006D8")]
	[Address(RVA = "0xA653C0", Offset = "0xA641C0", VA = "0x180A653C0")]
	public void RemoveObjectID(int id)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060006D9 RID: 1753 RVA: 0x000104A8 File Offset: 0x0000E6A8
	[Token(Token = "0x60006D9")]
	[Address(RVA = "0xA64970", Offset = "0xA63770", VA = "0x180A64970")]
	private void AddMonsterHPBar(NPCManage npc)
	{
		NPCManage npc2 = npc;
		if (!npc2.<HasHPBarAttached>k__BackingField)
		{
			npc2.<HasHPBarAttached>k__BackingField = true;
			List<EnemiesManager.EnemyData> list = this.enemies;
			Func<EnemiesManager.EnemyData, bool> func = delegate(EnemiesManager.EnemyData enemy)
			{
				NPCManage npc3 = enemy.Npc;
				NPCManage npc4 = npc;
				return npc3 == npc4;
			};
			EnemiesManager.EnemyData enemyData = Enumerable.FirstOrDefault<EnemiesManager.EnemyData>(list, func);
			if (enemyData != 0)
			{
				Game.AddEnemyHPBar(enemyData);
			}
		}
	}

	// Token: 0x060006DA RID: 1754 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60006DA")]
	[Address(RVA = "0xA64D50", Offset = "0xA63B50", VA = "0x180A64D50")]
	public Transform GetSceneCenterEnemy(Camera playerCamera, Vector3 v3Center, float fSDistance, float fWDistance)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060006DB RID: 1755 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60006DB")]
	[Address(RVA = "0xA64AC0", Offset = "0xA638C0", VA = "0x180A64AC0")]
	public void AreaShowEnemy(GameObject Scane)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060006DC RID: 1756 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60006DC")]
	[Address(RVA = "0xA654D0", Offset = "0xA642D0", VA = "0x180A654D0")]
	public void ResetEnemyDeath()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060006DD RID: 1757 RVA: 0x00010508 File Offset: 0x0000E708
	[Token(Token = "0x60006DD")]
	[Address(RVA = "0x2B4010", Offset = "0x2B2E10", VA = "0x1802B4010")]
	public List<EnemiesManager.EnemyData> GetAllEnemyData()
	{
		return this.enemies;
	}

	// Token: 0x060006DE RID: 1758 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60006DE")]
	[Address(RVA = "0xA655C0", Offset = "0xA643C0", VA = "0x180A655C0")]
	public void SetTimeScale(float timeScale)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060006DF RID: 1759 RVA: 0x0001051C File Offset: 0x0000E71C
	[Token(Token = "0x60006DF")]
	[Address(RVA = "0xA656E0", Offset = "0xA644E0", VA = "0x180A656E0")]
	public EnemiesManager()
	{
		LockPointsManager lockPointsManager = new LockPointsManager();
		this.LockPointsManager = lockPointsManager;
		base..ctor();
	}

	// Token: 0x040007FA RID: 2042
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x40007FA")]
	private List<EnemiesManager.EnemyData> enemies;

	// Token: 0x0200009B RID: 155
	[Token(Token = "0x200009B")]
	public class EnemyData
	{
		// Token: 0x1700002E RID: 46
		// (get) Token: 0x060006E0 RID: 1760 RVA: 0x0001053C File Offset: 0x0000E73C
		[Token(Token = "0x1700002E")]
		public CharacterBaseData CharData
		{
			[Token(Token = "0x60006E0")]
			[Address(RVA = "0x5FA150", Offset = "0x5F8F50", VA = "0x1805FA150")]
			get
			{
				return this.Npc.g_CharData;
			}
		}

		// Token: 0x1700002F RID: 47
		// (get) Token: 0x060006E1 RID: 1761 RVA: 0x0001055C File Offset: 0x0000E75C
		[Token(Token = "0x1700002F")]
		public Transform HPPosition
		{
			[Token(Token = "0x60006E1")]
			[Address(RVA = "0x5FA170", Offset = "0x5F8F70", VA = "0x1805FA170")]
			get
			{
				return this.Npc.HpPosition;
			}
		}

		// Token: 0x17000030 RID: 48
		// (get) Token: 0x060006E2 RID: 1762 RVA: 0x0001057C File Offset: 0x0000E77C
		[Token(Token = "0x17000030")]
		public Transform PosTipsPosition
		{
			[Token(Token = "0x60006E2")]
			[Address(RVA = "0x5FA190", Offset = "0x5F8F90", VA = "0x1805FA190")]
			get
			{
				return this.Npc.g_LockPosition[0].transform;
			}
		}

		// Token: 0x060006E3 RID: 1763 RVA: 0x000105A8 File Offset: 0x0000E7A8
		[Token(Token = "0x60006E3")]
		[Address(RVA = "0x3D8B20", Offset = "0x3D7920", VA = "0x1803D8B20")]
		public EnemyData()
		{
		}

		// Token: 0x040007FC RID: 2044
		[FieldOffset(Offset = "0x10")]
		[Token(Token = "0x40007FC")]
		public NPCManage Npc;
	}
}
