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

Classes

class  Row
 
class  Stage
 

Public Member Functions

override Row CreateRow ()
 
override void SetRow (Row r)
 
override void BackupPref ()
 
override void RestorePref ()
 
override void ValidatePref ()
 
string GetName (int id)
 
override void OnAfterImportData ()
 
override void OnInit ()
 
- Public Member Functions inherited from SourceDataInt< SourceObj.Row >
override T GetRow (string id)
 

Public Attributes

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

Static Public Attributes

static RenderData FallbackRenderData
 

Detailed Description

Definition at line 4 of file SourceObj.cs.

Member Function Documentation

◆ BackupPref()

override void SourceObj.BackupPref ( )
inline

Definition at line 124 of file SourceObj.cs.

125 {
126 _rows.Clear();
127 foreach (Row row in rows)
128 {
129 _rows[row.id] = row;
130 }
131 }
Dictionary< int, Row > _rows
Definition: SourceObj.cs:77

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceObj.CreateRow ( )
inline

Definition at line 81 of file SourceObj.cs.

82 {
83 return new Row
84 {
85 id = SourceData.GetInt(0),
86 alias = SourceData.GetString(1),
87 name_JP = SourceData.GetString(2),
88 name = SourceData.GetString(3),
89 _growth = SourceData.GetStringArray(4),
90 costSoil = SourceData.GetInt(5),
91 objType = SourceData.GetString(6),
92 vals = SourceData.GetStringArray(7),
94 sort = SourceData.GetInt(9),
95 reqHarvest = SourceData.GetStringArray(10),
96 hp = SourceData.GetInt(11),
97 _tileType = SourceData.GetString(12),
98 valType = SourceData.GetString(13),
99 _idRenderData = SourceData.GetString(14),
100 tiles = SourceData.GetIntArray(15),
101 snowTile = SourceData.GetInt(16),
102 colorMod = SourceData.GetInt(17),
103 colorType = SourceData.GetString(18),
104 value = SourceData.GetInt(19),
105 LV = SourceData.GetInt(20),
106 chance = SourceData.GetInt(21),
107 recipeKey = SourceData.GetStringArray(22),
108 factory = SourceData.GetStringArray(23),
109 components = SourceData.GetStringArray(24),
110 defMat = SourceData.GetString(25),
111 matCategory = SourceData.GetString(26),
112 category = SourceData.GetString(27),
113 idRoof = SourceData.GetInt(28),
114 detail_JP = SourceData.GetString(29),
115 detail = SourceData.GetString(30)
116 };
117 }
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 int[] GetIntArray(int id)
Definition: SourceData.cs:736

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

◆ GetName()

string SourceObj.GetName ( int  id)
inline

Definition at line 149 of file SourceObj.cs.

150 {
151 return map[id].GetName().ToTitleCase();
152 }

Referenced by Cell.GetObjName(), ActBash.Perform(), TraitSeed.SetName(), LayerInfo.SetObj(), and ObjInfo.WriteNote().

◆ OnAfterImportData()

override void SourceObj.OnAfterImportData ( )
inline

Definition at line 154 of file SourceObj.cs.

155 {
156 int num = 0;
157 foreach (Row row in rows)
158 {
159 if (row.sort != 0)
160 {
161 num = row.sort;
162 }
163 row.sort = num;
164 num++;
165 }
166 rows.Sort((Row a, Row b) => a.id - b.id);
167 }

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceObj.OnInit ( )
inline

Definition at line 169 of file SourceObj.cs.

170 {
171 FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/obj");
172 Cell.objList = rows;
173 foreach (Row row in rows)
174 {
175 row.Init();
176 }
177 }
void Init()
Definition: RenderData.cs:94
static RenderData FallbackRenderData
Definition: SourceObj.cs:79

References FallbackRenderData, and TileRow.Init().

◆ RestorePref()

override void SourceObj.RestorePref ( )
inline

Definition at line 133 of file SourceObj.cs.

134 {
135 foreach (Row row in rows)
136 {
137 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
138 }
139 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceObj.SetRow ( Row  r)
inline

Definition at line 119 of file SourceObj.cs.

120 {
121 map[r.id] = r;
122 }

References TileRow.id.

◆ ValidatePref()

override void SourceObj.ValidatePref ( )
inline

Definition at line 141 of file SourceObj.cs.

142 {
143 foreach (Row row in rows)
144 {
145 row.pref.Validate();
146 }
147 }

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

Referenced by SourcePrefInspector.ValidatePrefs().

Member Data Documentation

◆ _rows

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

Definition at line 77 of file SourceObj.cs.

Referenced by BackupPref(), and RestorePref().

◆ FallbackRenderData

RenderData SourceObj.FallbackRenderData
static

Definition at line 79 of file SourceObj.cs.

Referenced by OnInit().


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