summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/BarrageQueue.cs
blob: be8b570d54fa86a36d9a30963e6b3ec322bdabfa (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
using System;
using System.Collections.Generic;

namespace XMainClient
{
	internal class BarrageQueue
	{
		public int queueCnt
		{
			get
			{
				return this.mItems.Count;
			}
		}

		public int depth = 1;

		private List<BarrageItem> mItems = new List<BarrageItem>();

		public void Fire(BarrageItem item, string txt, bool outline)
		{
			this.mItems.Add(item);
			item.Make(txt, this, outline);
			this.depth++;
		}

		public bool FadeOut(BarrageItem item)
		{
			bool flag = this.mItems.Contains(item);
			bool result;
			if (flag)
			{
				this.mItems.Remove(item);
				result = true;
			}
			else
			{
				result = false;
			}
			return result;
		}

		public void ForceClear()
		{
			for (int i = 0; i < this.mItems.Count; i++)
			{
				bool flag = this.mItems[i] != null && this.mItems[i].gameObject != null;
				if (flag)
				{
					this.mItems[i].Drop();
				}
			}
			this.mItems.Clear();
			this.depth = 1;
		}
	}
}