summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/DlgHandlerMgr.cs
blob: fd80d25f34ed9b46f4f6bc05298c798ccd9fd557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;

namespace XMainClient
{
	public class DlgHandlerMgr
	{
		private List<DlgHandlerBase> m_ListHandler = new List<DlgHandlerBase>();

		public void Add(DlgHandlerBase handler)
		{
			this.m_ListHandler.Add(handler);
		}

		public void Remove(DlgHandlerBase handler)
		{
			this.m_ListHandler.Remove(handler);
		}

		public void Unload()
		{
			for (int i = 0; i < this.m_ListHandler.Count; i++)
			{
				this.m_ListHandler[i].UnLoad();
			}
			this.m_ListHandler.Clear();
		}

		public void StackRefresh()
		{
			for (int i = 0; i < this.m_ListHandler.Count; i++)
			{
				bool flag = this.m_ListHandler[i].IsVisible();
				if (flag)
				{
					this.m_ListHandler[i].StackRefresh();
				}
			}
		}

		public void LeaveStackTop()
		{
			for (int i = 0; i < this.m_ListHandler.Count; i++)
			{
				bool flag = this.m_ListHandler[i].IsVisible();
				if (flag)
				{
					this.m_ListHandler[i].LeaveStackTop();
				}
			}
		}

		public void OnUpdate()
		{
			for (int i = 0; i < this.m_ListHandler.Count; i++)
			{
				bool flag = this.m_ListHandler[i].IsVisible();
				if (flag)
				{
					this.m_ListHandler[i].OnUpdate();
				}
			}
		}
	}
}