using System;
using System.Collections.Generic;
using Cpp2IlInjected;

// Token: 0x020002E8 RID: 744
[Token(Token = "0x20002E8")]
public class UIStackingManager
{
	// Token: 0x06001BD7 RID: 7127 RVA: 0x00042084 File Offset: 0x00040284
	[Token(Token = "0x6001BD7")]
	[Address(RVA = "0x18ACC10", Offset = "0x18ABA10", VA = "0x1818ACC10")]
	public void AppendCanvas(GameCanvasBase canvas)
	{
		if (this.isRecording && !this.canvasStack.Contains(canvas))
		{
			this.canvasStack.Push(canvas);
		}
	}

	// Token: 0x06001BD8 RID: 7128 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001BD8")]
	[Address(RVA = "0x18ACFC0", Offset = "0x18ABDC0", VA = "0x1818ACFC0")]
	public void RemoveCanvas(GameCanvasBase canvas)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001BD9 RID: 7129 RVA: 0x000420BC File Offset: 0x000402BC
	[Token(Token = "0x6001BD9")]
	[Address(RVA = "0x18ACF60", Offset = "0x18ABD60", VA = "0x1818ACF60")]
	public void Init(UIStackingManager.UIStackingCommand cmdType)
	{
		Stack<GameCanvasBase> stack = this.canvasStack;
		this.isRecording = false;
		stack.Clear();
		this.defaultCmdType = cmdType;
		this.currentCmdType = cmdType;
	}

	// Token: 0x06001BDA RID: 7130 RVA: 0x000420F4 File Offset: 0x000402F4
	[Token(Token = "0x6001BDA")]
	[Address(RVA = "0x6E41D0", Offset = "0x6E2FD0", VA = "0x1806E41D0")]
	public void Record()
	{
		this.isRecording = true;
	}

	// Token: 0x06001BDB RID: 7131 RVA: 0x00042108 File Offset: 0x00040308
	[Token(Token = "0x6001BDB")]
	[Address(RVA = "0x18AD0B0", Offset = "0x18ABEB0", VA = "0x1818AD0B0")]
	public void Stop()
	{
		Stack<GameCanvasBase> stack = this.canvasStack;
		this.isRecording = false;
		stack.Clear();
	}

	// Token: 0x06001BDC RID: 7132 RVA: 0x00042130 File Offset: 0x00040330
	[Token(Token = "0x6001BDC")]
	[Address(RVA = "0x4681D0", Offset = "0x466FD0", VA = "0x1804681D0")]
	public UIStackingManager.UIStackingCommand GetDefaultCommand()
	{
		return this.defaultCmdType;
	}

	// Token: 0x06001BDD RID: 7133 RVA: 0x00042144 File Offset: 0x00040344
	[Token(Token = "0x6001BDD")]
	[Address(RVA = "0x412680", Offset = "0x411480", VA = "0x180412680")]
	public void SetCommand(UIStackingManager.UIStackingCommand cmdType)
	{
		this.currentCmdType = cmdType;
	}

	// Token: 0x06001BDE RID: 7134 RVA: 0x00042158 File Offset: 0x00040358
	[Token(Token = "0x6001BDE")]
	[Address(RVA = "0x18AD0A0", Offset = "0x18ABEA0", VA = "0x1818AD0A0")]
	public void ResetDefaultCommand()
	{
		UIStackingManager.UIStackingCommand uistackingCommand = this.defaultCmdType;
		this.currentCmdType = uistackingCommand;
	}

	// Token: 0x06001BDF RID: 7135 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001BDF")]
	[Address(RVA = "0x18ACD20", Offset = "0x18ABB20", VA = "0x1818ACD20")]
	public void ExecuteCommand()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001BE0 RID: 7136 RVA: 0x00042174 File Offset: 0x00040374
	[Token(Token = "0x6001BE0")]
	[Address(RVA = "0x18ACCA0", Offset = "0x18ABAA0", VA = "0x1818ACCA0")]
	private void ClosePeekCanvas()
	{
		GameCanvasBase gameCanvasBase = this.pendingStack.Pop();
		if (gameCanvasBase.Enabled)
		{
			gameCanvasBase.Init();
			return;
		}
	}

	// Token: 0x06001BE1 RID: 7137 RVA: 0x000421A4 File Offset: 0x000403A4
	[Token(Token = "0x6001BE1")]
	[Address(RVA = "0x18ACEB0", Offset = "0x18ABCB0", VA = "0x1818ACEB0")]
	private void ForceCloseCanvases(int times)
	{
		int num = 0;
		if (times > 0)
		{
			GameCanvasBase gameCanvasBase = this.pendingStack.Pop();
			if (gameCanvasBase.Enabled)
			{
				int num2 = 0;
				gameCanvasBase.ForceClose(num2);
			}
			num++;
		}
	}

	// Token: 0x06001BE2 RID: 7138 RVA: 0x000421E0 File Offset: 0x000403E0
	[Token(Token = "0x6001BE2")]
	[Address(RVA = "0x18AD100", Offset = "0x18ABF00", VA = "0x1818AD100")]
	public UIStackingManager()
	{
		Stack<GameCanvasBase> stack = new Stack();
		this.canvasStack = stack;
		Stack<GameCanvasBase> stack2 = new Stack();
		this.pendingStack = stack2;
		base..ctor();
	}

	// Token: 0x0400256F RID: 9583
	[FieldOffset(Offset = "0x10")]
	[Token(Token = "0x400256F")]
	private Stack<GameCanvasBase> canvasStack;

	// Token: 0x04002570 RID: 9584
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002570")]
	private Stack<GameCanvasBase> pendingStack;

	// Token: 0x04002571 RID: 9585
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002571")]
	private UIStackingManager.UIStackingCommand currentCmdType;

	// Token: 0x04002572 RID: 9586
	[FieldOffset(Offset = "0x24")]
	[Token(Token = "0x4002572")]
	private UIStackingManager.UIStackingCommand defaultCmdType;

	// Token: 0x04002573 RID: 9587
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002573")]
	private bool isRecording;

	// Token: 0x020002E9 RID: 745
	[Token(Token = "0x20002E9")]
	public enum UIStackingCommand
	{
		// Token: 0x04002575 RID: 9589
		[Token(Token = "0x4002575")]
		Default,
		// Token: 0x04002576 RID: 9590
		[Token(Token = "0x4002576")]
		Close,
		// Token: 0x04002577 RID: 9591
		[Token(Token = "0x4002577")]
		ForceClose,
		// Token: 0x04002578 RID: 9592
		[Token(Token = "0x4002578")]
		ForceCloseAll
	}
}
