using System;
using System.Linq;
using Cpp2IlInjected;
using MarsSDK;
using UnityEngine;

// Token: 0x02000181 RID: 385
[Token(Token = "0x2000181")]
public class ItemPool
{
	// Token: 0x0600130A RID: 4874 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600130A")]
	[Address(RVA = "0x104DE40", Offset = "0x104CE40", VA = "0x18104DE40")]
	public ItemPool(string itemName, Transform root, ItemSystem.ItemType itemType, int size, float aliveTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600130B RID: 4875 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600130B")]
	[Address(RVA = "0x104DBE0", Offset = "0x104CBE0", VA = "0x18104DBE0")]
	private void RegisterItemProcessor()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600130C RID: 4876 RVA: 0x0002B2DC File Offset: 0x000294DC
	[Token(Token = "0x600130C")]
	[Address(RVA = "0x104D8A0", Offset = "0x104C8A0", VA = "0x18104D8A0")]
	public void Init()
	{
		AssetItemRequest assetItemRequest = new AssetItemRequest(this.itemName);
		AssetItemRequest req = assetItemRequest;
		AssetItemRequest req2 = req;
		Action action = delegate
		{
			int assetGroup = req.AssetGroup;
			string <AssetName>k__BackingField = req.<AssetName>k__BackingField;
			Item component = Game.GetAsset<GameObject>(assetGroup, <AssetName>k__BackingField).GetComponent<Item>();
			ItemPool <>4__this = this;
			float g_fUseTime = component.g_fUseTime;
			<>4__this.useTime = g_fUseTime;
		};
		req2.<OnFinished>k__BackingField = action;
		Game.LoadAsset(req);
	}

	// Token: 0x0600130D RID: 4877 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600130D")]
	[Address(RVA = "0x104D9F0", Offset = "0x104C9F0", VA = "0x18104D9F0")]
	public Item NewUse(Vector3 position, Quaternion rotation, bool isDiscarded)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600130E RID: 4878 RVA: 0x0002B338 File Offset: 0x00029538
	[Token(Token = "0x600130E")]
	[Address(RVA = "0x104D800", Offset = "0x104C800", VA = "0x18104D800")]
	public void AllCheckFloor()
	{
		GameObjectPoolLimited<Item> gameObjectPoolLimited = this.pooledItems;
		Action<Item> action = this.itemProcessor;
		gameObjectPoolLimited.ProcessActivePool(action);
	}

	// Token: 0x0600130F RID: 4879 RVA: 0x0002B360 File Offset: 0x00029560
	[Token(Token = "0x600130F")]
	[Address(RVA = "0x104DD00", Offset = "0x104CD00", VA = "0x18104DD00")]
	public bool TryGetActiveProperty(int propertyID)
	{
		Item[] activePoolClone = this.pooledItems.GetActivePoolClone();
		Func<Item, bool> func = delegate(Item property)
		{
			int propertyID2 = propertyID;
			return property.g_iPropertyID == propertyID2;
		};
		Item item = Enumerable.FirstOrDefault<Item>(activePoolClone, func);
		int num = 0;
		return item != num;
	}

	// Token: 0x06001310 RID: 4880 RVA: 0x0002B3AC File Offset: 0x000295AC
	[Token(Token = "0x6001310")]
	[Address(RVA = "0xB94720", Offset = "0xB93720", VA = "0x180B94720")]
	public float GetUseTime()
	{
		return this.useTime;
	}

	// Token: 0x06001311 RID: 4881 RVA: 0x0002B3C0 File Offset: 0x000295C0
	[Token(Token = "0x6001311")]
	[Address(RVA = "0x104D850", Offset = "0x104C850", VA = "0x18104D850")]
	public void Dispose()
	{
		this.pooledItems.Dispose();
	}

	// Token: 0x04001CD3 RID: 7379
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x4001CD3")]
	private GameObjectPoolLimited<Item> pooledItems;

	// Token: 0x04001CD4 RID: 7380
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4001CD4")]
	private Action<Item> itemProcessor;

	// Token: 0x04001CD5 RID: 7381
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001CD5")]
	private string itemName;

	// Token: 0x04001CD6 RID: 7382
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001CD6")]
	private float useTime;

	// Token: 0x04001CD7 RID: 7383
	[FieldOffset(Offset = "0x2C")]
	[Token(Token = "0x4001CD7")]
	private float aliveTime;
}
