Elin Modding Docs Doc
Loading...
Searching...
No Matches
SpatialManager.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Newtonsoft.Json;
5
6// Token: 0x020006E5 RID: 1765
7public class SpatialManager : EClass
8{
9 // Token: 0x060032F4 RID: 13044 RVA: 0x00117C96 File Offset: 0x00115E96
10 public void AssignUID(Spatial s)
11 {
12 s.uid = this.uidNext;
13 this.uidNext++;
14 this.map.Add(s);
15 }
16
17 // Token: 0x060032F5 RID: 13045 RVA: 0x00117CBE File Offset: 0x00115EBE
18 public void Remove(Spatial s)
19 {
20 if (s.parent != null)
21 {
22 s.parent.children.Remove(s);
23 }
24 this.map.Remove(s.uid);
25 this.listDestryoed.Add(s);
26 }
27
28 // Token: 0x060032F6 RID: 13046 RVA: 0x00117CF8 File Offset: 0x00115EF8
29 public T Find<T>(Func<T, bool> func) where T : Zone
30 {
31 foreach (Spatial spatial in this.map.Values)
32 {
33 T t = spatial as T;
34 if (t != null && func(t))
35 {
36 return t;
37 }
38 }
39 return default(T);
40 }
41
42 // Token: 0x060032F7 RID: 13047 RVA: 0x00117D74 File Offset: 0x00115F74
43 public Zone Find(string id)
44 {
45 foreach (Spatial spatial in this.map.Values)
46 {
47 if (spatial is Zone && spatial.id == id)
48 {
49 return spatial as Zone;
50 }
51 }
52 return null;
53 }
54
55 // Token: 0x060032F8 RID: 13048 RVA: 0x00117DE8 File Offset: 0x00115FE8
56 public Zone Find(int uid)
57 {
58 return this.map.TryGetValue(uid, null) as Zone;
59 }
60
61 // Token: 0x060032F9 RID: 13049 RVA: 0x00117DFC File Offset: 0x00115FFC
62 public List<Zone> ListReturnLocations()
63 {
64 if (EClass.debug.returnAnywhere)
65 {
66 return (from Zone a in
67 from a in this.map.Values
68 where a is Zone
69 select a
70 where a != EClass._zone && (a.IsReturnLocation || a.IsPCFaction || (!(a is Zone_Field) && !a.IsInstance && !a.isRandomSite)) && a.parent == EClass.world.region && !a.source.tag.Contains("closed")
71 select a).ToList<Zone>();
72 }
73 return (from Zone a in
74 from a in this.map.Values
75 where a is Zone
76 select a
77 where a != EClass._zone && a.IsReturnLocation && a.GetTopZone().visitCount > 0 && (a.GetTopZone().FindDeepestZone() == a || EClass.pc.homeZone == a)
78 select a).ToList<Zone>();
79 }
80
81 // Token: 0x17000F3B RID: 3899
82 // (get) Token: 0x060032FA RID: 13050 RVA: 0x00117ED0 File Offset: 0x001160D0
83 public List<Zone> Zones
84 {
85 get
86 {
87 return (from a in this.map.Values
88 where a is Zone
89 select a).Cast<Zone>().ToList<Zone>();
90 }
91 }
92
93 // Token: 0x04001BF9 RID: 7161
94 [JsonProperty]
96
97 // Token: 0x04001BFA RID: 7162
98 [JsonProperty]
99 public int uidNext = 1;
100
101 // Token: 0x04001BFB RID: 7163
102 [JsonProperty]
103 public RankedZoneManager ranks = new RankedZoneManager();
104
105 // Token: 0x04001BFC RID: 7164
106 public List<Spatial> listDestryoed = new List<Spatial>();
107
108 // Token: 0x02000C0C RID: 3084
109 public class GlobalSpatialList : Dictionary<int, Spatial>
110 {
111 // Token: 0x0600461A RID: 17946 RVA: 0x00160BAA File Offset: 0x0015EDAA
112 public void Add(Spatial s)
113 {
114 base.Add(s.uid, s);
115 }
116 }
117}
Definition Zone.cs:14