-
Notifications
You must be signed in to change notification settings - Fork 7
/
13Serializables.cs
98 lines (83 loc) · 2.24 KB
/
13Serializables.cs
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
using GTA;
using System;
using System.Collections;
using System.Collections.Generic;
namespace ZombiesMod
{
[Serializable]
public class Map : ICollection<MapProp>, IEnumerable<MapProp>, IEnumerable
{
public List<MapProp> Props;
public event Map.OnListChangedEvent ListChanged;
public Map()
{
this.Props = new List<MapProp>();
this.IsReadOnly = false;
}
public int Count
{
get
{
return this.Props.Count;
}
}
public bool IsReadOnly { get; }
IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator) this.GetEnumerator();
}
public IEnumerator<MapProp> GetEnumerator()
{
return (IEnumerator<MapProp>) this.Props.GetEnumerator();
}
public void Add(MapProp item)
{
this.Props.Add(item);
// ISSUE: reference to a compiler-generated field
Map.OnListChangedEvent listChanged = this.ListChanged;
if (listChanged == null)
return;
listChanged(this.Props.Count);
}
public void Clear()
{
while (this.Props.Count > 0)
{
MapProp prop = this.Props[0];
prop.Delete();
this.Props.Remove(prop);
}
}
public bool Contains(MapProp item)
{
return this.Props.Contains(item);
}
public void CopyTo(MapProp[] array, int arrayIndex)
{
this.Props.CopyTo(array, arrayIndex);
}
public bool Remove(MapProp item)
{
if (!this.Props.Remove(item))
return false;
// ISSUE: reference to a compiler-generated field
Map.OnListChangedEvent listChanged = this.ListChanged;
if (listChanged != null)
listChanged(this.Props.Count);
return true;
}
public bool Contains(Prop prop)
{
return this.Props.Find((Predicate<MapProp>) (m => m.Handle == ((Entity) prop).get_Handle())) != null;
}
public void NotifyListChanged()
{
// ISSUE: reference to a compiler-generated field
Map.OnListChangedEvent listChanged = this.ListChanged;
if (listChanged == null)
return;
listChanged(this.Count);
}
public delegate void OnListChangedEvent(int count);
}
}