Elin Decompiled Documentation EA 23.285 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 327 of file SourceMaterial.cs.

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

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

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

References SourceMaterial.Row.id.

◆ OnImportRow()

void SourceMaterial.OnImportRow ( Row  r)
inline

Definition at line 423 of file SourceMaterial.cs.

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

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

◆ OnInit()

override void SourceMaterial.OnInit ( )
inline

Definition at line 373 of file SourceMaterial.cs.

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

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

References SourceMaterial.Row.id.

Member Data Documentation

◆ tierMap

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

Definition at line 323 of file SourceMaterial.cs.

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

Property Documentation

◆ ImportFields

override string [] SourceMaterial.ImportFields
get

Definition at line 325 of file SourceMaterial.cs.


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