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

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

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

References SourceMaterial.Row.id.

◆ OnImportRow()

void SourceMaterial.OnImportRow ( Row  r)
inline

Definition at line 403 of file SourceMaterial.cs.

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

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

◆ OnInit()

override void SourceMaterial.OnInit ( )
inline

Definition at line 353 of file SourceMaterial.cs.

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

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

References SourceMaterial.Row.id.

Member Data Documentation

◆ tierMap

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

Definition at line 303 of file SourceMaterial.cs.

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

Property Documentation

◆ ImportFields

override string [] SourceMaterial.ImportFields
get

Definition at line 305 of file SourceMaterial.cs.


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