Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
MapSubset.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.IO;
3using Newtonsoft.Json;
4using UnityEngine;
5
6public class MapSubset : EClass
7{
8 [JsonProperty]
9 public string id;
10
11 [JsonProperty]
12 public List<int> listClear = new List<int>();
13
14 [JsonProperty]
16
17 public static bool Exist(string id)
18 {
19 return File.Exists(CorePath.ZoneSave + EClass._zone.idExport + "_" + id + ".s");
20 }
21
22 public static void Save(string id)
23 {
24 if (EClass._zone.subset == null)
25 {
26 EClass._zone.subset = new MapSubset();
27 }
29 EClass._zone.idCurrentSubset = id;
31 }
32
33 public static MapSubset Load(string id)
34 {
35 return GameIO.LoadFile<MapSubset>(CorePath.ZoneSave + EClass._zone.idExport + "_" + id + ".s");
36 }
37
38 public void OnSave(string _id)
39 {
40 id = _id;
41 listClear.Clear();
42 EClass._map.ForeachCell(delegate(Cell c)
43 {
44 if (c.isClearArea)
45 {
46 listClear.Add(c.index);
47 }
48 });
49 serializedCards.cards.Clear();
50 foreach (Card card in EClass._map.Cards)
51 {
52 if (card.isSubsetCard)
53 {
55 }
56 }
57 Debug.Log(listClear.Count);
58 }
59
60 public void Apply()
61 {
62 Debug.Log(listClear.Count);
63 foreach (int item in listClear)
64 {
65 Cell cell = EClass._map.GetCell(item);
66 cell.isClearArea = true;
67 cell.Things.ForeachReverse(delegate(Thing t)
68 {
69 t.Destroy();
70 });
71 }
72 serializedCards.Restore(EClass._map, null, addToZone: true);
73 }
74}
Definition: Card.cs:11
void Destroy()
Definition: Card.cs:4538
Definition: Cell.cs:7
List< Thing > Things
Definition: Cell.cs:986
bool isClearArea
Definition: Cell.cs:606
static string ZoneSave
Definition: CorePath.cs:196
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
Definition: GameIO.cs:10
static void SaveFile(string path, object obj)
Definition: GameIO.cs:254
SerializedCards serializedCards
Definition: MapSubset.cs:15
void Apply()
Definition: MapSubset.cs:60
string id
Definition: MapSubset.cs:9
static bool Exist(string id)
Definition: MapSubset.cs:17
List< int > listClear
Definition: MapSubset.cs:12
static void Save(string id)
Definition: MapSubset.cs:22
static MapSubset Load(string id)
Definition: MapSubset.cs:33
void OnSave(string _id)
Definition: MapSubset.cs:38
new void ForeachCell(Action< Cell > action)
Definition: Map.cs:2324
Cell GetCell(int index)
Definition: Map.cs:881
IEnumerable< Card > Cards
Definition: Map.cs:135
void Add(Card c)
List< Data > cards
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
Definition: Thing.cs:8
virtual string idExport
Definition: Zone.cs:147
MapSubset subset
Definition: Zone.cs:62