Elin Modding Docs Doc
Loading...
Searching...
No Matches
SourceFloor.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x0200001B RID: 27
5public class SourceFloor : SourceDataInt<SourceFloor.Row>
6{
7 // Token: 0x06000109 RID: 265 RVA: 0x0000AA10 File Offset: 0x00008C10
8 public override SourceFloor.Row CreateRow()
9 {
10 return new SourceFloor.Row
11 {
12 id = SourceData.GetInt(0),
13 alias = SourceData.GetString(1),
14 name_JP = SourceData.GetString(2),
15 name = SourceData.GetString(3),
16 sort = SourceData.GetInt(4),
17 idBiome = SourceData.GetString(5),
18 reqHarvest = SourceData.GetStringArray(6),
19 hp = SourceData.GetInt(7),
20 _tileType = SourceData.GetString(8),
21 _idRenderData = SourceData.GetString(9),
22 tiles = SourceData.GetIntArray(10),
23 colorMod = SourceData.GetInt(11),
24 value = SourceData.GetInt(12),
25 LV = SourceData.GetInt(13),
26 recipeKey = SourceData.GetStringArray(14),
27 factory = SourceData.GetStringArray(15),
28 components = SourceData.GetStringArray(16),
29 defMat = SourceData.GetString(17),
30 defBlock = SourceData.GetString(18),
31 bridgeBlock = SourceData.GetString(19),
32 category = SourceData.GetString(20),
33 edge = SourceData.GetInt(21),
34 autotile = SourceData.GetInt(22),
35 autotilePriority = SourceData.GetInt(23),
36 autotileBrightness = SourceData.GetFloat(24),
37 soundFoot = SourceData.GetString(25),
38 tag = SourceData.GetStringArray(26),
39 detail_JP = SourceData.GetString(27),
40 detail = SourceData.GetString(28)
41 };
42 }
43
44 // Token: 0x0600010A RID: 266 RVA: 0x0000AB92 File Offset: 0x00008D92
45 public override void SetRow(SourceFloor.Row r)
46 {
47 this.map[r.id] = r;
48 }
49
50 // Token: 0x0600010B RID: 267 RVA: 0x0000ABA8 File Offset: 0x00008DA8
51 public override void BackupPref()
52 {
53 this._rows.Clear();
54 foreach (SourceFloor.Row row in this.rows)
55 {
56 this._rows[row.id] = row;
57 }
58 }
59
60 // Token: 0x0600010C RID: 268 RVA: 0x0000AC14 File Offset: 0x00008E14
61 public override void RestorePref()
62 {
63 foreach (SourceFloor.Row row in this.rows)
64 {
65 RenderRow renderRow = row;
66 SourceFloor.Row row2 = this._rows.TryGetValue(row.id, null);
67 renderRow.pref = (((row2 != null) ? row2.pref : null) ?? new SourcePref());
68 }
69 }
70
71 // Token: 0x0600010D RID: 269 RVA: 0x0000AC90 File Offset: 0x00008E90
72 public override void ValidatePref()
73 {
74 foreach (SourceFloor.Row row in this.rows)
75 {
76 row.pref.Validate();
77 }
78 }
79
80 // Token: 0x0600010E RID: 270 RVA: 0x0000ACE8 File Offset: 0x00008EE8
81 public override void OnAfterImportData()
82 {
83 int num = 0;
84 foreach (SourceFloor.Row row in this.rows)
85 {
86 if (row.sort != 0)
87 {
88 num = row.sort;
89 }
90 row.sort = num;
91 num++;
92 }
93 this.rows.Sort((SourceFloor.Row a, SourceFloor.Row b) => a.id - b.id);
94 }
95
96 // Token: 0x0600010F RID: 271 RVA: 0x0000AD7C File Offset: 0x00008F7C
97 public override void OnInit()
98 {
99 SourceFloor.FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/floor");
100 Cell.floorList = this.rows;
101 foreach (SourceFloor.Row row in this.rows)
102 {
103 row.Init();
104 }
105 }
106
107 // Token: 0x06000110 RID: 272 RVA: 0x0000ADE8 File Offset: 0x00008FE8
108 public void OnAfterInit()
109 {
110 foreach (SourceFloor.Row row in this.rows)
111 {
112 row._defBlock = EClass.sources.blocks.alias[row.defBlock];
113 row._bridgeBlock = EClass.sources.blocks.alias[row.bridgeBlock];
114 row.nonGradient = row.ContainsTag("nonGradient");
115 }
116 }
117
118 // Token: 0x040000D6 RID: 214
119 public Dictionary<int, SourceFloor.Row> _rows = new Dictionary<int, SourceFloor.Row>();
120
121 // Token: 0x040000D7 RID: 215
122 public static RenderData FallbackRenderData;
123
124 // Token: 0x0200079C RID: 1948
125 [Serializable]
126 public class Row : TileRow
127 {
128 // Token: 0x170010D9 RID: 4313
129 // (get) Token: 0x06003739 RID: 14137 RVA: 0x0012A874 File Offset: 0x00128A74
130 public override bool UseAlias
131 {
132 get
133 {
134 return true;
135 }
136 }
137
138 // Token: 0x170010DA RID: 4314
139 // (get) Token: 0x0600373A RID: 14138 RVA: 0x0012A877 File Offset: 0x00128A77
140 public override string GetAlias
141 {
142 get
143 {
144 return this.alias;
145 }
146 }
147
148 // Token: 0x170010DB RID: 4315
149 // (get) Token: 0x0600373B RID: 14139 RVA: 0x0012A87F File Offset: 0x00128A7F
150 public override string RecipeID
151 {
152 get
153 {
154 return "f" + this.id.ToString();
155 }
156 }
157
158 // Token: 0x170010DC RID: 4316
159 // (get) Token: 0x0600373C RID: 14140 RVA: 0x0012A896 File Offset: 0x00128A96
160 public override RenderData defaultRenderData
161 {
162 get
163 {
164 return SourceFloor.FallbackRenderData;
165 }
166 }
167
168 // Token: 0x0600373D RID: 14141 RVA: 0x0012A8A0 File Offset: 0x00128AA0
169 public override void OnInit()
170 {
171 this.ignoreTransition = this.tag.Contains("noTransition");
172 this.ignoreSnow = this.tag.Contains("noSnow");
173 this.isBeach = this.tag.Contains("beach");
174 this.snowtile = this.tag.Contains("snowtile");
175 if (!this.idBiome.IsEmpty())
176 {
177 this.biome = EClass.core.refs.biomes.dict[this.idBiome];
178 }
179 }
180
181 // Token: 0x0600373E RID: 14142 RVA: 0x0012A937 File Offset: 0x00128B37
182 public override int GetTile(SourceMaterial.Row mat, int dir = 0)
183 {
184 return this._tiles[dir % this._tiles.Length];
185 }
186
187 // Token: 0x04001FC3 RID: 8131
188 public string idBiome;
189
190 // Token: 0x04001FC4 RID: 8132
191 public string[] reqHarvest;
192
193 // Token: 0x04001FC5 RID: 8133
194 public string defBlock;
195
196 // Token: 0x04001FC6 RID: 8134
197 public string bridgeBlock;
198
199 // Token: 0x04001FC7 RID: 8135
200 public int edge;
201
202 // Token: 0x04001FC8 RID: 8136
203 public int autotile;
204
205 // Token: 0x04001FC9 RID: 8137
206 public int autotilePriority;
207
208 // Token: 0x04001FCA RID: 8138
209 public float autotileBrightness;
210
211 // Token: 0x04001FCB RID: 8139
212 public bool nonGradient;
213
214 // Token: 0x04001FCC RID: 8140
215 public bool isBeach;
216
217 // Token: 0x04001FCD RID: 8141
218 public bool snowtile;
219
220 // Token: 0x04001FCE RID: 8142
221 public bool ignoreTransition;
222
223 // Token: 0x04001FCF RID: 8143
224 [NonSerialized]
225 public SourceBlock.Row _defBlock;
226
227 // Token: 0x04001FD0 RID: 8144
228 [NonSerialized]
229 public SourceBlock.Row _bridgeBlock;
230
231 // Token: 0x04001FD1 RID: 8145
232 [NonSerialized]
233 public BiomeProfile biome;
234
235 // Token: 0x04001FD2 RID: 8146
236 public string name_L;
237
238 // Token: 0x04001FD3 RID: 8147
239 public string detail_L;
240 }
241}