Elin Decompiled Documentation EA 23.219 Nightly Patch 2
Loading...
Searching...
No Matches
SourceMaterial Class Reference
Inheritance diagram for SourceMaterial:
SourceDataInt< SourceMaterial.Row >

Classes

class  Row
 
class  Tier
 
class  TierList
 

Public Member Functions

override Row CreateRow ()
 
override void SetRow (Row r)
 
override void OnInit ()
 
override void OnAfterImportData ()
 
void OnImportRow (Row r)
 
- Public Member Functions inherited from SourceDataInt< SourceMaterial.Row >
override T GetRow (string id)
 

Static Public Attributes

static Dictionary< string, TierListtierMap = new Dictionary<string, TierList>()
 

Properties

override string[] ImportFields [get]
 

Detailed Description

Definition at line 5 of file SourceMaterial.cs.

Member Function Documentation

◆ CreateRow()

override Row SourceMaterial.CreateRow ( )
inline

Definition at line 308 of file SourceMaterial.cs.

309 {
310 return new Row
311 {
312 id = SourceData.GetInt(0),
313 alias = SourceData.GetString(1),
314 name_JP = SourceData.GetString(2),
315 name = SourceData.GetString(3),
316 category = SourceData.GetString(4),
317 tag = SourceData.GetStringArray(5),
318 thing = SourceData.GetString(6),
319 goods = SourceData.GetStringArray(7),
320 minerals = SourceData.GetStringArray(8),
321 decal = SourceData.GetInt(9),
322 decay = SourceData.GetInt(10),
323 grass = SourceData.GetInt(11),
324 defFloor = SourceData.GetInt(12),
325 defBlock = SourceData.GetInt(13),
326 edge = SourceData.GetInt(14),
327 ramp = SourceData.GetInt(15),
328 idSound = SourceData.GetString(16),
329 soundFoot = SourceData.GetString(17),
330 hardness = SourceData.GetInt(18),
331 groups = SourceData.GetStringArray(19),
332 tier = SourceData.GetInt(20),
333 chance = SourceData.GetInt(21),
334 weight = SourceData.GetInt(22),
335 value = SourceData.GetInt(23),
336 quality = SourceData.GetInt(24),
337 atk = SourceData.GetInt(25),
338 dmg = SourceData.GetInt(26),
339 dv = SourceData.GetInt(27),
340 pv = SourceData.GetInt(28),
341 dice = SourceData.GetInt(29),
342 bits = SourceData.GetStringArray(30),
343 elements = Core.ParseElements(SourceData.GetStr(31)),
344 altName = SourceData.GetStringArray(32),
345 altName_JP = SourceData.GetStringArray(33)
346 };
347 }
Definition: Core.cs:14
static int[] ParseElements(string str)
Definition: Core.cs:721
static string[] GetStringArray(int id)
Definition: SourceData.cs:741
static string GetString(int id)
Definition: SourceData.cs:746
static int GetInt(int id)
Definition: SourceData.cs:711
static string GetStr(int id, bool useDefault=false)
Definition: SourceData.cs:751

References SourceData< T, T2 >.GetInt(), SourceData< T, T2 >.GetStr(), SourceData< T, T2 >.GetString(), SourceData< T, T2 >.GetStringArray(), and Core.ParseElements().

◆ OnAfterImportData()

override void SourceMaterial.OnAfterImportData ( )
inline

Definition at line 399 of file SourceMaterial.cs.

400 {
401 rows.Sort((Row a, Row b) => a.id - b.id);
402 }

References SourceMaterial.Row.id.

◆ OnImportRow()

void SourceMaterial.OnImportRow ( Row  r)
inline

Definition at line 404 of file SourceMaterial.cs.

405 {
406 List<int> list = new List<int>(r.elements);
407 for (int i = 0; i < r.elements.Length; i += 2)
408 {
409 Add(r.elements[i], r.elements[i + 1]);
410 }
411 Add(13, r.hardness);
412 r.elements = list.ToArray();
413 void Add(int ele, int a)
414 {
415 list.Add(ele);
416 list.Add(a);
417 }
418 }
list. Add(item3)

References Add(), SourceMaterial.Row.elements, and SourceMaterial.Row.hardness.

◆ OnInit()

override void SourceMaterial.OnInit ( )
inline

Definition at line 354 of file SourceMaterial.cs.

355 {
356 Cell.matList = rows;
357 tierMap.Clear();
358 tierMap.Add("gem", new TierList());
359 tierMap.Add("ore", new TierList());
360 foreach (Row row in rows)
361 {
362 row.Init();
363 row.elementMap = Element.GetElementMap(row.elements);
364 if (!row.groups.IsEmpty())
365 {
366 string[] groups = row.groups;
367 foreach (string key in groups)
368 {
369 TierList tierList = tierMap.TryGetValue(key);
370 if (tierList == null)
371 {
372 tierList = new TierList();
373 tierMap[key] = tierList;
374 }
375 Tier obj = tierList.tiers[row.tier];
376 obj.list.Add(row);
377 obj.sum += row.chance;
378 }
379 }
380 string category = row.category;
381 if (!(category == "gem"))
382 {
383 if (category == "ore")
384 {
385 Tier obj2 = tierMap["ore"].tiers[row.tier];
386 obj2.list.Add(row);
387 obj2.sum += row.chance;
388 }
389 }
390 else
391 {
392 Tier obj3 = tierMap["gem"].tiers[row.tier];
393 obj3.list.Add(row);
394 obj3.sum += row.chance;
395 }
396 }
397 }
static Dictionary< int, int > GetElementMap(int[] list)
Definition: ELEMENT.cs:531
static Dictionary< string, TierList > tierMap

References SourceMaterial.Row.category, SourceMaterial.Row.chance, SourceMaterial.Row.elements, Element.GetElementMap(), SourceMaterial.Row.groups, SourceMaterial.Row.Init(), SourceMaterial.Tier.list, SourceMaterial.Row.tier, tierMap, and SourceMaterial.TierList.tiers.

◆ SetRow()

override void SourceMaterial.SetRow ( Row  r)
inline

Definition at line 349 of file SourceMaterial.cs.

350 {
351 map[r.id] = r;
352 }

References SourceMaterial.Row.id.

Member Data Documentation

◆ tierMap

Dictionary<string, TierList> SourceMaterial.tierMap = new Dictionary<string, TierList>()
static

Definition at line 304 of file SourceMaterial.cs.

Referenced by MATERIAL.GetRandomMaterial(), OnInit(), and ActEffect.Proc().

Property Documentation

◆ ImportFields

override string [] SourceMaterial.ImportFields
get

Definition at line 306 of file SourceMaterial.cs.


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