Elin Decompiled Documentation EA 23.321 Nightly Patch 1
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 186 of file SourceDeco.cs.

187 {
188 _rows.Clear();
189 foreach (Row row in rows)
190 {
191 _rows[row.id] = row;
192 }
193 }
Dictionary< int, Row > _rows
Definition: SourceDeco.cs:99

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceDeco.CreateRow ( )
inline

Definition at line 101 of file SourceDeco.cs.

102 {
103 return new Row
104 {
105 id = SourceData.GetInt(0),
106 alias = SourceData.GetString(1),
107 name_JP = SourceData.GetString(2),
108 name = SourceData.GetString(3),
109 sort = SourceData.GetInt(4),
110 idBiome = SourceData.GetString(5),
111 reqHarvest = SourceData.GetStringArray(6),
112 hp = SourceData.GetInt(7),
113 _tileType = SourceData.GetString(8),
114 _idRenderData = SourceData.GetString(9),
115 tiles = SourceData.GetIntArray(10),
116 anime = SourceData.GetIntArray(11),
117 colorMod = SourceData.GetInt(12),
118 value = SourceData.GetInt(13),
119 LV = SourceData.GetInt(14),
120 recipeKey = SourceData.GetStringArray(15),
121 factory = SourceData.GetStringArray(16),
122 components = SourceData.GetStringArray(17),
123 defMat = SourceData.GetString(18),
124 category = SourceData.GetString(19),
125 edge = SourceData.GetInt(20),
126 autotile = SourceData.GetInt(21),
127 autotilePriority = SourceData.GetInt(22),
128 autotileBrightness = SourceData.GetFloat(23),
129 soundFoot = SourceData.GetString(24),
130 tag = SourceData.GetStringArray(25),
131 detail_JP = SourceData.GetString(26),
132 detail = SourceData.GetString(27)
133 };
134 }
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 136 of file SourceDeco.cs.

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

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 176 of file SourceDeco.cs.

177 {
178 return RowMapping;
179 }
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceDeco.cs:35

References RowMapping.

◆ GetTypeMapping()

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

Definition at line 181 of file SourceDeco.cs.

182 {
183 return TypeMapping;
184 }
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceDeco.cs:67

References TypeMapping.

◆ OnAfterImportData()

override void SourceDeco.OnAfterImportData ( )
inline

Definition at line 211 of file SourceDeco.cs.

212 {
213 int num = 0;
214 foreach (Row row in rows)
215 {
216 if (row.sort != 0)
217 {
218 num = row.sort;
219 }
220 row.sort = num;
221 num++;
222 }
223 rows.Sort((Row a, Row b) => a.id - b.id);
224 }

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceDeco.OnInit ( )
inline

Definition at line 226 of file SourceDeco.cs.

227 {
228 Cell.decoList = rows;
229 foreach (Row row in rows)
230 {
231 row.Init();
232 }
233 }

References TileRow.Init().

◆ RestorePref()

override void SourceDeco.RestorePref ( )
inline

Definition at line 195 of file SourceDeco.cs.

196 {
197 foreach (Row row in rows)
198 {
199 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
200 }
201 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceDeco.SetRow ( Row  r)
inline

Definition at line 171 of file SourceDeco.cs.

172 {
173 map[r.id] = r;
174 }

References TileRow.id.

◆ ValidatePref()

override void SourceDeco.ValidatePref ( )
inline

Definition at line 203 of file SourceDeco.cs.

204 {
205 foreach (Row row in rows)
206 {
207 row.pref.Validate();
208 }
209 }

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

Member Data Documentation

◆ _rows

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

Definition at line 99 of file SourceDeco.cs.

Referenced by BackupPref(), and RestorePref().

◆ RowMapping

readonly IReadOnlyDictionary<string, int> SourceDeco.RowMapping
static

Definition at line 35 of file SourceDeco.cs.

Referenced by GetRowMapping().

◆ TypeMapping

readonly IReadOnlyDictionary<string, string> SourceDeco.TypeMapping
static

Definition at line 67 of file SourceDeco.cs.

Referenced by GetTypeMapping().


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