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

Classes

class  Row
 

Public Member Functions

override Row CreateRow ()
 
override Row CreateRowByMapping (IReadOnlyDictionary< string, int > mapping)
 
override void SetRow (Row r)
 
override IReadOnlyDictionary< string, int > GetRowMapping ()
 
override IReadOnlyDictionary< string, string > GetTypeMapping ()
 
override void BackupPref ()
 
override void RestorePref ()
 
override void ValidatePref ()
 
override void OnAfterImportData ()
 
override void OnInit ()
 
- Public Member Functions inherited from SourceDataInt< SourceDeco.Row >
override T GetRow (string id)
 

Public Attributes

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

Static Public Attributes

static readonly IReadOnlyDictionary< string, int > RowMapping
 
static readonly IReadOnlyDictionary< string, string > TypeMapping
 

Detailed Description

Definition at line 4 of file SourceDeco.cs.

Member Function Documentation

◆ BackupPref()

override void SourceDeco.BackupPref ( )
inline

Definition at line 192 of file SourceDeco.cs.

193 {
194 _rows.Clear();
195 foreach (Row row in rows)
196 {
197 _rows[row.id] = row;
198 }
199 }
Dictionary< int, Row > _rows
Definition: SourceDeco.cs:105

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceDeco.CreateRow ( )
inline

Definition at line 107 of file SourceDeco.cs.

108 {
109 return new Row
110 {
111 id = SourceData.GetInt(0),
112 alias = SourceData.GetString(1),
113 name_JP = SourceData.GetString(2),
114 name = SourceData.GetString(3),
115 sort = SourceData.GetInt(4),
116 idBiome = SourceData.GetString(5),
117 reqHarvest = SourceData.GetStringArray(6),
118 hp = SourceData.GetInt(7),
119 _tileType = SourceData.GetString(8),
120 _idRenderData = SourceData.GetString(9),
121 tiles = SourceData.GetIntArray(10),
122 anime = SourceData.GetIntArray(11),
123 colorMod = SourceData.GetInt(12),
124 value = SourceData.GetInt(13),
125 LV = SourceData.GetInt(14),
126 recipeKey = SourceData.GetStringArray(15),
127 factory = SourceData.GetStringArray(16),
128 components = SourceData.GetStringArray(17),
129 defMat = SourceData.GetString(18),
130 category = SourceData.GetString(19),
131 edge = SourceData.GetInt(20),
132 autotile = SourceData.GetInt(21),
133 autotilePriority = SourceData.GetInt(22),
134 autotileBrightness = SourceData.GetFloat(23),
135 soundFoot = SourceData.GetString(24),
136 tag = SourceData.GetStringArray(25),
137 detail_JP = SourceData.GetString(26),
138 detail = SourceData.GetString(27)
139 };
140 }
static float GetFloat(int id)
Definition: SourceData.cs:996
static string[] GetStringArray(int id)
Definition: SourceData.cs:1011
static string GetString(int id)
Definition: SourceData.cs:1016
static int GetInt(int id)
Definition: SourceData.cs:981
static int[] GetIntArray(int id)
Definition: SourceData.cs:1006

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

◆ CreateRowByMapping()

override Row SourceDeco.CreateRowByMapping ( IReadOnlyDictionary< string, int >  mapping)
inline

Definition at line 142 of file SourceDeco.cs.

143 {
144 return new Row
145 {
146 id = SourceData.GetInt(mapping["id"]),
147 alias = SourceData.GetString(mapping["alias"]),
148 name_JP = SourceData.GetString(mapping["name_JP"]),
149 name = SourceData.GetString(mapping["name"]),
150 sort = SourceData.GetInt(mapping["sort"]),
151 idBiome = SourceData.GetString(mapping["idBiome"]),
152 reqHarvest = SourceData.GetStringArray(mapping["reqHarvest"]),
153 hp = SourceData.GetInt(mapping["hp"]),
154 _tileType = SourceData.GetString(mapping["_tileType"]),
155 _idRenderData = SourceData.GetString(mapping["_idRenderData"]),
156 tiles = SourceData.GetIntArray(mapping["tiles"]),
157 anime = SourceData.GetIntArray(mapping["anime"]),
158 colorMod = SourceData.GetInt(mapping["colorMod"]),
159 value = SourceData.GetInt(mapping["value"]),
160 LV = SourceData.GetInt(mapping["LV"]),
161 recipeKey = SourceData.GetStringArray(mapping["recipeKey"]),
162 factory = SourceData.GetStringArray(mapping["factory"]),
163 components = SourceData.GetStringArray(mapping["components"]),
164 defMat = SourceData.GetString(mapping["defMat"]),
165 category = SourceData.GetString(mapping["category"]),
166 edge = SourceData.GetInt(mapping["edge"]),
167 autotile = SourceData.GetInt(mapping["autotile"]),
168 autotilePriority = SourceData.GetInt(mapping["autotilePriority"]),
169 autotileBrightness = SourceData.GetFloat(mapping["autotileBrightness"]),
170 soundFoot = SourceData.GetString(mapping["soundFoot"]),
171 tag = SourceData.GetStringArray(mapping["tag"]),
172 detail_JP = SourceData.GetString(mapping["detail_JP"]),
173 detail = SourceData.GetString(mapping["detail"])
174 };
175 }

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

◆ GetRowMapping()

override IReadOnlyDictionary< string, int > SourceDeco.GetRowMapping ( )
inline

Definition at line 182 of file SourceDeco.cs.

183 {
184 return RowMapping;
185 }
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceDeco.cs:41

References RowMapping.

◆ GetTypeMapping()

override IReadOnlyDictionary< string, string > SourceDeco.GetTypeMapping ( )
inline

Definition at line 187 of file SourceDeco.cs.

188 {
189 return TypeMapping;
190 }
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceDeco.cs:73

References TypeMapping.

◆ OnAfterImportData()

override void SourceDeco.OnAfterImportData ( )
inline

Definition at line 217 of file SourceDeco.cs.

218 {
219 int num = 0;
220 foreach (Row row in rows)
221 {
222 if (row.sort != 0)
223 {
224 num = row.sort;
225 }
226 row.sort = num;
227 num++;
228 }
229 rows.Sort((Row a, Row b) => a.id - b.id);
230 }

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceDeco.OnInit ( )
inline

Definition at line 232 of file SourceDeco.cs.

233 {
234 Cell.decoList = rows;
235 foreach (Row row in rows)
236 {
237 row.Init();
238 }
239 }

References TileRow.Init().

◆ RestorePref()

override void SourceDeco.RestorePref ( )
inline

Definition at line 201 of file SourceDeco.cs.

202 {
203 foreach (Row row in rows)
204 {
205 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
206 }
207 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceDeco.SetRow ( Row  r)
inline

Definition at line 177 of file SourceDeco.cs.

178 {
179 map[r.id] = r;
180 }

References TileRow.id.

◆ ValidatePref()

override void SourceDeco.ValidatePref ( )
inline

Definition at line 209 of file SourceDeco.cs.

210 {
211 foreach (Row row in rows)
212 {
213 row.pref.Validate();
214 }
215 }

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

Member Data Documentation

◆ _rows

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

Definition at line 105 of file SourceDeco.cs.

Referenced by BackupPref(), and RestorePref().

◆ RowMapping

readonly IReadOnlyDictionary<string, int> SourceDeco.RowMapping
static

Definition at line 41 of file SourceDeco.cs.

Referenced by GetRowMapping().

◆ TypeMapping

readonly IReadOnlyDictionary<string, string> SourceDeco.TypeMapping
static

Definition at line 73 of file SourceDeco.cs.

Referenced by GetTypeMapping().


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