Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SerStack.cs
Go to the documentation of this file.
2
3internal sealed class SerStack
4{
5 internal object[] _objects = new object[5];
6
7 internal string _stackId;
8
9 internal int _top = -1;
10
11 internal SerStack(string stackId)
12 {
14 }
15
16 internal void Push(object obj)
17 {
18 if (_top == _objects.Length - 1)
19 {
21 }
22 _objects[++_top] = obj;
23 }
24
25 internal object Pop()
26 {
27 if (_top < 0)
28 {
29 return null;
30 }
31 object result = _objects[_top];
32 _objects[_top--] = null;
33 return result;
34 }
35
36 internal void IncreaseCapacity()
37 {
38 int num = _objects.Length * 2;
39 object[] array = new object[num];
42 }
43
44 internal object Peek()
45 {
46 if (_top >= 0)
47 {
48 return _objects[_top];
49 }
50 return null;
51 }
52
53 internal object PeekPeek()
54 {
55 if (_top >= 1)
56 {
57 return _objects[_top - 1];
58 }
59 return null;
60 }
61
62 internal bool IsEmpty()
63 {
64 return _top <= 0;
65 }
66}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624