Elin Modding Docs Doc
Loading...
Searching...
No Matches
MapSubset.cs
1using System;
2using System.Collections.Generic;
3using System.IO;
4using Newtonsoft.Json;
5using UnityEngine;
6
7// Token: 0x02000699 RID: 1689
8public class MapSubset : EClass
9{
10 // Token: 0x0600311B RID: 12571 RVA: 0x001132F9 File Offset: 0x001114F9
11 public static bool Exist(string id)
12 {
13 return File.Exists(string.Concat(new string[]
14 {
15 CorePath.ZoneSave,
16 EClass._zone.idExport,
17 "_",
18 id,
19 ".s"
20 }));
21 }
22
23 // Token: 0x0600311C RID: 12572 RVA: 0x00113334 File Offset: 0x00111534
24 public static void Save(string id)
25 {
26 if (EClass._zone.subset == null)
27 {
28 EClass._zone.subset = new MapSubset();
29 }
30 EClass._zone.subset.OnSave(id);
31 EClass._zone.idCurrentSubset = id;
32 GameIO.SaveFile(string.Concat(new string[]
33 {
34 CorePath.ZoneSave,
35 EClass._zone.idExport,
36 "_",
37 id,
38 ".s"
39 }), EClass._zone.subset);
40 }
41
42 // Token: 0x0600311D RID: 12573 RVA: 0x001133BA File Offset: 0x001115BA
43 public static MapSubset Load(string id)
44 {
45 return GameIO.LoadFile<MapSubset>(string.Concat(new string[]
46 {
47 CorePath.ZoneSave,
48 EClass._zone.idExport,
49 "_",
50 id,
51 ".s"
52 }));
53 }
54
55 // Token: 0x0600311E RID: 12574 RVA: 0x001133F8 File Offset: 0x001115F8
56 public void OnSave(string _id)
57 {
58 this.id = _id;
59 this.listClear.Clear();
60 EClass._map.ForeachCell(delegate(Cell c)
61 {
62 if (c.isClearArea)
63 {
64 this.listClear.Add(c.index);
65 }
66 });
67 this.serializedCards.cards.Clear();
68 foreach (Card card in EClass._map.Cards)
69 {
70 if (card.isSubsetCard)
71 {
72 this.serializedCards.Add(card);
73 }
74 }
75 Debug.Log(this.listClear.Count);
76 }
77
78 // Token: 0x0600311F RID: 12575 RVA: 0x001134A4 File Offset: 0x001116A4
79 public void Apply()
80 {
81 Debug.Log(this.listClear.Count);
82 foreach (int index in this.listClear)
83 {
84 Cell cell = EClass._map.GetCell(index);
85 cell.isClearArea = true;
86 cell.Things.ForeachReverse(delegate(Thing t)
87 {
88 t.Destroy();
89 });
90 }
91 this.serializedCards.Restore(EClass._map, null, true, null);
92 }
93
94 // Token: 0x04001B33 RID: 6963
95 [JsonProperty]
96 public string id;
97
98 // Token: 0x04001B34 RID: 6964
99 [JsonProperty]
100 public List<int> listClear = new List<int>();
101
102 // Token: 0x04001B35 RID: 6965
103 [JsonProperty]
104 public SerializedCards serializedCards = new SerializedCards();
105}
Definition Card.cs:13
Definition Cell.cs:10
Definition Thing.cs:10