Elin Decompiled Documentation EA 23.299 Nightly
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 328 of file SourceMaterial.cs.

329 {
330 return new Row
331 {
332 id = SourceData.GetInt(0),
333 alias = SourceData.GetString(1),
334 name_JP = SourceData.GetString(2),
335 name = SourceData.GetString(3),
336 category = SourceData.GetString(4),
337 tag = SourceData.GetStringArray(5),
338 thing = SourceData.GetString(6),
339 goods = SourceData.GetStringArray(7),
340 minerals = SourceData.GetStringArray(8),
341 decal = SourceData.GetInt(9),
342 decay = SourceData.GetInt(10),
343 grass = SourceData.GetInt(11),
344 defFloor = SourceData.GetInt(12),
345 defBlock = SourceData.GetInt(13),
346 edge = SourceData.GetInt(14),
347 ramp = SourceData.GetInt(15),
348 idSound = SourceData.GetString(16),
349 soundFoot = SourceData.GetString(17),
350 hardness = SourceData.GetInt(18),
351 groups = SourceData.GetStringArray(19),
352 tier = SourceData.GetInt(20),
353 chance = SourceData.GetInt(21),
354 weight = SourceData.GetInt(22),
355 value = SourceData.GetInt(23),
356 quality = SourceData.GetInt(24),
357 atk = SourceData.GetInt(25),
358 dmg = SourceData.GetInt(26),
359 dv = SourceData.GetInt(27),
360 pv = SourceData.GetInt(28),
361 dice = SourceData.GetInt(29),
362 bits = SourceData.GetStringArray(30),
363 elements = Core.ParseElements(SourceData.GetStr(31)),
364 altName = SourceData.GetStringArray(32),
365 altName_JP = SourceData.GetStringArray(33)
366 };
367 }
Definition: Core.cs:14
static int[] ParseElements(string str)
Definition: Core.cs:726
static string[] GetStringArray(int id)
Definition: SourceData.cs:922
static string GetString(int id)
Definition: SourceData.cs:927
static int GetInt(int id)
Definition: SourceData.cs:892
static string GetStr(int id, bool useDefault=false)
Definition: SourceData.cs:932

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 419 of file SourceMaterial.cs.

420 {
421 rows.Sort((Row a, Row b) => a.id - b.id);
422 }

References SourceMaterial.Row.id.

◆ OnImportRow()

void SourceMaterial.OnImportRow ( Row  r)
inline

Definition at line 424 of file SourceMaterial.cs.

425 {
426 List<int> list = new List<int>(r.elements);
427 for (int i = 0; i < r.elements.Length; i += 2)
428 {
429 Add(r.elements[i], r.elements[i + 1]);
430 }
431 Add(13, r.hardness);
432 r.elements = list.ToArray();
433 void Add(int ele, int a)
434 {
435 list.Add(ele);
436 list.Add(a);
437 }
438 }
list. Add(item3)

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

◆ OnInit()

override void SourceMaterial.OnInit ( )
inline

Definition at line 374 of file SourceMaterial.cs.

375 {
376 Cell.matList = rows;
377 tierMap.Clear();
378 tierMap.Add("gem", new TierList());
379 tierMap.Add("ore", new TierList());
380 foreach (Row row in rows)
381 {
382 row.Init();
383 row.elementMap = Element.GetElementMap(row.elements);
384 if (!row.groups.IsEmpty())
385 {
386 string[] groups = row.groups;
387 foreach (string key in groups)
388 {
389 TierList tierList = tierMap.TryGetValue(key);
390 if (tierList == null)
391 {
392 tierList = new TierList();
393 tierMap[key] = tierList;
394 }
395 Tier obj = tierList.tiers[row.tier];
396 obj.list.Add(row);
397 obj.sum += row.chance;
398 }
399 }
400 string category = row.category;
401 if (!(category == "gem"))
402 {
403 if (category == "ore")
404 {
405 Tier obj2 = tierMap["ore"].tiers[row.tier];
406 obj2.list.Add(row);
407 obj2.sum += row.chance;
408 }
409 }
410 else
411 {
412 Tier obj3 = tierMap["gem"].tiers[row.tier];
413 obj3.list.Add(row);
414 obj3.sum += row.chance;
415 }
416 }
417 }
static Dictionary< int, int > GetElementMap(int[] list)
Definition: ELEMENT.cs:536
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 369 of file SourceMaterial.cs.

370 {
371 map[r.id] = r;
372 }

References SourceMaterial.Row.id.

Member Data Documentation

◆ tierMap

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

Definition at line 324 of file SourceMaterial.cs.

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

Property Documentation

◆ ImportFields

override string [] SourceMaterial.ImportFields
get

Definition at line 326 of file SourceMaterial.cs.


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