Elin Decompiled Documentation EA 23.351.2 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
 

Properties

TileLookup< Row > Lookup [get]
 
Row this[int id] [get]
 

Private Attributes

TileLookup< Row > _lookup
 

Detailed Description

Definition at line 4 of file SourceDeco.cs.

Member Function Documentation

◆ BackupPref()

override void SourceDeco.BackupPref ( )
inline

Definition at line 199 of file SourceDeco.cs.

200 {
201 _rows.Clear();
202 foreach (Row row in rows)
203 {
204 _rows[row.id] = row;
205 }
206 }
Dictionary< int, Row > _rows
Definition: SourceDeco.cs:105

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceDeco.CreateRow ( )
inline

Definition at line 114 of file SourceDeco.cs.

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

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

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

190 {
191 return RowMapping;
192 }
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceDeco.cs:41

References RowMapping.

◆ GetTypeMapping()

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

Definition at line 194 of file SourceDeco.cs.

195 {
196 return TypeMapping;
197 }
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceDeco.cs:73

References TypeMapping.

◆ OnAfterImportData()

override void SourceDeco.OnAfterImportData ( )
inline

Definition at line 224 of file SourceDeco.cs.

225 {
226 int num = 0;
227 foreach (Row row in rows)
228 {
229 if (row.sort != 0)
230 {
231 num = row.sort;
232 }
233 row.sort = num;
234 num++;
235 }
236 rows.Sort((Row r) => r.id);
237 }

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceDeco.OnInit ( )
inline

Definition at line 239 of file SourceDeco.cs.

240 {
241 Lookup.Build();
242 Cell.decoSource = this;
243 Cell.decoList = rows;
244 foreach (Row row in rows)
245 {
246 row.Init();
247 }
248 }
TileLookup< Row > Lookup
Definition: SourceDeco.cs:110

References TileRow.Init(), and Lookup.

◆ RestorePref()

override void SourceDeco.RestorePref ( )
inline

Definition at line 208 of file SourceDeco.cs.

209 {
210 foreach (Row row in rows)
211 {
212 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
213 }
214 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceDeco.SetRow ( Row  r)
inline

Definition at line 184 of file SourceDeco.cs.

185 {
186 map[r.id] = r;
187 }

References TileRow.id.

◆ ValidatePref()

override void SourceDeco.ValidatePref ( )
inline

Definition at line 216 of file SourceDeco.cs.

217 {
218 foreach (Row row in rows)
219 {
220 row.pref.Validate();
221 }
222 }

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

Member Data Documentation

◆ _lookup

TileLookup<Row> SourceDeco._lookup
private

Definition at line 108 of file SourceDeco.cs.

◆ _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().

Property Documentation

◆ Lookup

TileLookup<Row> SourceDeco.Lookup
getprivate

Definition at line 110 of file SourceDeco.cs.

Referenced by OnInit().

◆ this[int id]

Row SourceDeco.this[int id]
get

Definition at line 112 of file SourceDeco.cs.


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