Elin Decompiled Documentation EA 23.350.1 Nightly
Loading...
Searching...
No Matches
SourceBlock Class Reference
Inheritance diagram for SourceBlock:
SourceDataInt< SourceBlock.Row >

Classes

class  Row
 

Public Member Functions

override Row CreateRow ()
 
override Row CreateRowByMapping (IReadOnlyDictionary< string, int > mapping)
 
override void SetRow (Row r)
 
override IReadOnlyDictionary< string, int > GetRowMapping ()
 
override IReadOnlyDictionary< string, string > GetTypeMapping ()
 
override void BackupPref ()
 
override void RestorePref ()
 
override void ValidatePref ()
 
override void OnAfterImportData ()
 
override void OnInit ()
 
- Public Member Functions inherited from SourceDataInt< SourceBlock.Row >
override T GetRow (string id)
 

Public Attributes

Dictionary< int, Row > _rows = new Dictionary<int, Row>()
 

Static Public Attributes

static readonly IReadOnlyDictionary< string, int > RowMapping
 
static readonly IReadOnlyDictionary< string, string > TypeMapping
 
static RenderData FallbackRenderData
 

Properties

TileLookup< Row > Lookup [get]
 
Row this[int id] [get]
 

Private Attributes

TileLookup< Row > _lookup
 

Detailed Description

Definition at line 5 of file SourceBlock.cs.

Member Function Documentation

◆ BackupPref()

override void SourceBlock.BackupPref ( )
inline

Definition at line 244 of file SourceBlock.cs.

245 {
246 _rows.Clear();
247 foreach (Row row in rows)
248 {
249 _rows[row.id] = row;
250 }
251 }
Dictionary< int, Row > _rows
Definition: SourceBlock.cs:142

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceBlock.CreateRow ( )
inline

Definition at line 153 of file SourceBlock.cs.

154 {
155 return new Row
156 {
157 id = SourceData.GetInt(0),
158 alias = SourceData.GetString(1),
159 name_JP = SourceData.GetString(2),
160 name = SourceData.GetString(3),
161 sort = SourceData.GetInt(4),
162 reqHarvest = SourceData.GetStringArray(5),
163 hp = SourceData.GetInt(6),
164 idThing = SourceData.GetString(7),
165 _tileType = SourceData.GetString(8),
166 _idRenderData = SourceData.GetString(9),
167 tiles = SourceData.GetIntArray(10),
168 anime = SourceData.GetIntArray(11),
169 snowTile = SourceData.GetInt(12),
170 colorMod = SourceData.GetInt(13),
171 colorType = SourceData.GetString(14),
172 value = SourceData.GetInt(15),
173 LV = SourceData.GetInt(16),
174 recipeKey = SourceData.GetStringArray(17),
175 factory = SourceData.GetStringArray(18),
176 components = SourceData.GetStringArray(19),
177 defMat = SourceData.GetString(20),
178 category = SourceData.GetString(21),
179 roof = SourceData.GetInt(22),
180 autoFloor = SourceData.GetString(23),
181 concrete = SourceData.GetBool(24),
182 transparent = SourceData.GetBool(25),
183 transition = SourceData.GetIntArray(26),
184 tag = SourceData.GetStringArray(27),
185 soundFoot = SourceData.GetString(28),
186 detail_JP = SourceData.GetString(29),
187 detail = SourceData.GetString(30)
188 };
189 }
static string[] GetStringArray(int id)
Definition: SourceData.cs:1011
static string GetString(int id)
Definition: SourceData.cs:1016
static bool GetBool(int id)
Definition: SourceData.cs:986
static int GetInt(int id)
Definition: SourceData.cs:981
static int[] GetIntArray(int id)
Definition: SourceData.cs:1006

References SourceData< T, T2 >.GetBool(), SourceData< T, T2 >.GetInt(), SourceData< T, T2 >.GetIntArray(), SourceData< T, T2 >.GetString(), and SourceData< T, T2 >.GetStringArray().

◆ CreateRowByMapping()

override Row SourceBlock.CreateRowByMapping ( IReadOnlyDictionary< string, int >  mapping)
inline

Definition at line 191 of file SourceBlock.cs.

192 {
193 return new Row
194 {
195 id = SourceData.GetInt(mapping["id"]),
196 alias = SourceData.GetString(mapping["alias"]),
197 name_JP = SourceData.GetString(mapping["name_JP"]),
198 name = SourceData.GetString(mapping["name"]),
199 sort = SourceData.GetInt(mapping["sort"]),
200 reqHarvest = SourceData.GetStringArray(mapping["reqHarvest"]),
201 hp = SourceData.GetInt(mapping["hp"]),
202 idThing = SourceData.GetString(mapping["idThing"]),
203 _tileType = SourceData.GetString(mapping["_tileType"]),
204 _idRenderData = SourceData.GetString(mapping["_idRenderData"]),
205 tiles = SourceData.GetIntArray(mapping["tiles"]),
206 anime = SourceData.GetIntArray(mapping["anime"]),
207 snowTile = SourceData.GetInt(mapping["snowTile"]),
208 colorMod = SourceData.GetInt(mapping["colorMod"]),
209 colorType = SourceData.GetString(mapping["colorType"]),
210 value = SourceData.GetInt(mapping["value"]),
211 LV = SourceData.GetInt(mapping["LV"]),
212 recipeKey = SourceData.GetStringArray(mapping["recipeKey"]),
213 factory = SourceData.GetStringArray(mapping["factory"]),
214 components = SourceData.GetStringArray(mapping["components"]),
215 defMat = SourceData.GetString(mapping["defMat"]),
216 category = SourceData.GetString(mapping["category"]),
217 roof = SourceData.GetInt(mapping["roof"]),
218 autoFloor = SourceData.GetString(mapping["autoFloor"]),
219 concrete = SourceData.GetBool(mapping["concrete"]),
220 transparent = SourceData.GetBool(mapping["transparent"]),
221 transition = SourceData.GetIntArray(mapping["transition"]),
222 tag = SourceData.GetStringArray(mapping["tag"]),
223 soundFoot = SourceData.GetString(mapping["soundFoot"]),
224 detail_JP = SourceData.GetString(mapping["detail_JP"]),
225 detail = SourceData.GetString(mapping["detail"])
226 };
227 }

References SourceData< T, T2 >.GetBool(), SourceData< T, T2 >.GetInt(), SourceData< T, T2 >.GetIntArray(), SourceData< T, T2 >.GetString(), and SourceData< T, T2 >.GetStringArray().

◆ GetRowMapping()

override IReadOnlyDictionary< string, int > SourceBlock.GetRowMapping ( )
inline

Definition at line 234 of file SourceBlock.cs.

235 {
236 return RowMapping;
237 }
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceBlock.cs:72

References RowMapping.

◆ GetTypeMapping()

override IReadOnlyDictionary< string, string > SourceBlock.GetTypeMapping ( )
inline

Definition at line 239 of file SourceBlock.cs.

240 {
241 return TypeMapping;
242 }
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceBlock.cs:107

References TypeMapping.

◆ OnAfterImportData()

override void SourceBlock.OnAfterImportData ( )
inline

Definition at line 269 of file SourceBlock.cs.

270 {
271 int num = 0;
272 foreach (Row row in rows)
273 {
274 if (row.sort != 0)
275 {
276 num = row.sort;
277 }
278 row.sort = num;
279 num++;
280 }
281 rows.Sort((Row r) => r.id);
282 }

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceBlock.OnInit ( )
inline

Definition at line 284 of file SourceBlock.cs.

285 {
286 Lookup.Build();
287 FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/block");
288 Cell.blockSource = this;
289 Cell.blockList = rows;
291 foreach (Row row2 in rows)
292 {
293 row2.Init();
294 SourceFloor.Row row = (row2.autoFloor.IsEmpty() ? null : floors.alias.TryGetValue(row2.autoFloor));
295 if (row == null && !row2.autoFloor.IsEmpty())
296 {
297 Debug.LogWarning($"#source block {row2.id}/{row2.alias} has invalid floor alias '{row2.autoFloor}'");
298 }
299 row2.sourceAutoFloor = row ?? floors[40];
300 }
301 }
Definition: Core.cs:14
SourceManager sources
Definition: Core.cs:33
static new Core Instance
Definition: Core.cs:15
TileLookup< Row > Lookup
Definition: SourceBlock.cs:149
static RenderData FallbackRenderData
Definition: SourceBlock.cs:144
SourceFloor floors

References $, SourceBlock.Row.autoFloor, Debug, FallbackRenderData, SourceManager.floors, TileRow.Init(), Core.Instance, Lookup, and Core.sources.

◆ RestorePref()

override void SourceBlock.RestorePref ( )
inline

Definition at line 253 of file SourceBlock.cs.

254 {
255 foreach (Row row in rows)
256 {
257 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
258 }
259 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceBlock.SetRow ( Row  r)
inline

Definition at line 229 of file SourceBlock.cs.

230 {
231 map[r.id] = r;
232 }

References TileRow.id.

◆ ValidatePref()

override void SourceBlock.ValidatePref ( )
inline

Definition at line 261 of file SourceBlock.cs.

262 {
263 foreach (Row row in rows)
264 {
265 row.pref.Validate();
266 }
267 }

References RenderRow.pref, and SourcePref.Validate().

Member Data Documentation

◆ _lookup

TileLookup<Row> SourceBlock._lookup
private

Definition at line 147 of file SourceBlock.cs.

◆ _rows

Dictionary<int, Row> SourceBlock._rows = new Dictionary<int, Row>()

Definition at line 142 of file SourceBlock.cs.

Referenced by BackupPref(), and RestorePref().

◆ FallbackRenderData

RenderData SourceBlock.FallbackRenderData
static

Definition at line 144 of file SourceBlock.cs.

Referenced by OnInit().

◆ RowMapping

readonly IReadOnlyDictionary<string, int> SourceBlock.RowMapping
static

Definition at line 72 of file SourceBlock.cs.

Referenced by GetRowMapping().

◆ TypeMapping

readonly IReadOnlyDictionary<string, string> SourceBlock.TypeMapping
static

Definition at line 107 of file SourceBlock.cs.

Referenced by GetTypeMapping().

Property Documentation

◆ Lookup

TileLookup<Row> SourceBlock.Lookup
getprivate

Definition at line 149 of file SourceBlock.cs.

Referenced by OnInit().

◆ this[int id]

Row SourceBlock.this[int id]
get

Definition at line 151 of file SourceBlock.cs.


The documentation for this class was generated from the following file: