Elin Modding Docs Doc
Loading...
Searching...
No Matches
TeleportManager.cs
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4
5// Token: 0x02000468 RID: 1128
6public class TeleportManager : EClass
7{
8 // Token: 0x06001F59 RID: 8025 RVA: 0x000B19EC File Offset: 0x000AFBEC
9 public void SetID(TraitTeleporter t, int uidZone)
10 {
11 string id = t.id;
12 int uid = t.owner.uid;
13 if (id.IsEmpty())
14 {
15 this.Remove(uid);
16 return;
17 }
18 TeleportManager.Item item = this.items.TryGetValue(uid, null);
19 if (item == null)
20 {
21 item = new TeleportManager.Item();
22 this.items.Add(uid, item);
23 }
24 item.uidZone = uidZone;
25 item.id = id;
26 }
27
28 // Token: 0x06001F5A RID: 8026 RVA: 0x000B1A50 File Offset: 0x000AFC50
29 public Zone GetTeleportZone(TraitTeleporter t)
30 {
31 string id = t.id;
32 int uid = t.owner.uid;
33 if (id.IsEmpty())
34 {
35 return null;
36 }
37 List<Zone> list = new List<Zone>();
38 foreach (KeyValuePair<int, TeleportManager.Item> keyValuePair in this.items)
39 {
40 if (keyValuePair.Key != uid && keyValuePair.Value.id == id)
41 {
42 Zone zone = EClass.game.spatials.Find(keyValuePair.Value.uidZone);
43 if (zone != null && zone != EClass._zone)
44 {
45 list.Add(zone);
46 }
47 }
48 }
49 return list.RandomItem<Zone>();
50 }
51
52 // Token: 0x06001F5B RID: 8027 RVA: 0x000B1B18 File Offset: 0x000AFD18
53 public void Remove(int uidThing)
54 {
55 this.items.Remove(uidThing);
56 }
57
58 // Token: 0x040010D1 RID: 4305
59 [JsonProperty]
60 public Dictionary<int, TeleportManager.Item> items = new Dictionary<int, TeleportManager.Item>();
61
62 // Token: 0x020009DA RID: 2522
63 public class Item : EClass
64 {
65 // Token: 0x040028DD RID: 10461
66 [JsonProperty]
67 public string id;
68
69 // Token: 0x040028DE RID: 10462
70 [JsonProperty]
71 public int uidZone;
72 }
73}
Definition Zone.cs:14