Elin Decompiled Documentation EA 23.306 Nightly
Loading...
Searching...
No Matches
SourceBlock Class Reference
Inheritance diagram for SourceBlock:
SourceDataInt< SourceBlock.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 void BackupPref ()
 
override void RestorePref ()
 
override void ValidatePref ()
 
override void OnAfterImportData ()
 
override void OnInit ()
 
- Public Member Functions inherited from SourceDataInt< SourceBlock.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 RenderData FallbackRenderData
 

Detailed Description

Definition at line 4 of file SourceBlock.cs.

Member Function Documentation

◆ BackupPref()

override void SourceBlock.BackupPref ( )
inline

Definition at line 196 of file SourceBlock.cs.

197 {
198 _rows.Clear();
199 foreach (Row row in rows)
200 {
201 _rows[row.id] = row;
202 }
203 }
Dictionary< int, Row > _rows
Definition: SourceBlock.cs:106

References _rows, and TileRow.id.

◆ CreateRow()

override Row SourceBlock.CreateRow ( )
inline

Definition at line 110 of file SourceBlock.cs.

111 {
112 return new Row
113 {
114 id = SourceData.GetInt(0),
115 alias = SourceData.GetString(1),
116 name_JP = SourceData.GetString(2),
117 name = SourceData.GetString(3),
118 sort = SourceData.GetInt(4),
119 reqHarvest = SourceData.GetStringArray(5),
120 hp = SourceData.GetInt(6),
121 idThing = SourceData.GetString(7),
122 _tileType = SourceData.GetString(8),
123 _idRenderData = SourceData.GetString(9),
124 tiles = SourceData.GetIntArray(10),
125 anime = SourceData.GetIntArray(11),
126 snowTile = SourceData.GetInt(12),
127 colorMod = SourceData.GetInt(13),
128 colorType = SourceData.GetString(14),
129 value = SourceData.GetInt(15),
130 LV = SourceData.GetInt(16),
131 recipeKey = SourceData.GetStringArray(17),
132 factory = SourceData.GetStringArray(18),
133 components = SourceData.GetStringArray(19),
134 defMat = SourceData.GetString(20),
135 category = SourceData.GetString(21),
136 roof = SourceData.GetInt(22),
137 autoFloor = SourceData.GetString(23),
138 concrete = SourceData.GetBool(24),
139 transparent = SourceData.GetBool(25),
140 transition = SourceData.GetIntArray(26),
141 tag = SourceData.GetStringArray(27),
142 soundFoot = SourceData.GetString(28),
143 detail_JP = SourceData.GetString(29),
144 detail = SourceData.GetString(30)
145 };
146 }
static string[] GetStringArray(int id)
Definition: SourceData.cs:978
static string GetString(int id)
Definition: SourceData.cs:983
static bool GetBool(int id)
Definition: SourceData.cs:953
static int GetInt(int id)
Definition: SourceData.cs:948
static int[] GetIntArray(int id)
Definition: SourceData.cs:973

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

◆ CreateRowByMapping()

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

Definition at line 148 of file SourceBlock.cs.

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

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

◆ GetRowMapping()

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

Definition at line 191 of file SourceBlock.cs.

192 {
193 return RowMapping;
194 }
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceBlock.cs:71

References RowMapping.

◆ OnAfterImportData()

override void SourceBlock.OnAfterImportData ( )
inline

Definition at line 221 of file SourceBlock.cs.

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

References TileRow.id, and RenderRow.sort.

◆ OnInit()

override void SourceBlock.OnInit ( )
inline

Definition at line 236 of file SourceBlock.cs.

237 {
238 FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/block");
239 Cell.blockList = rows;
241 foreach (Row row in rows)
242 {
243 row.Init();
244 row.sourceAutoFloor = (row.autoFloor.IsEmpty() ? floors.rows[40] : floors.alias[row.autoFloor]);
245 }
246 }
Definition: Core.cs:14
SourceManager sources
Definition: Core.cs:33
static new Core Instance
Definition: Core.cs:15
static RenderData FallbackRenderData
Definition: SourceBlock.cs:108
SourceFloor floors

References SourceBlock.Row.autoFloor, FallbackRenderData, SourceManager.floors, TileRow.Init(), Core.Instance, and Core.sources.

◆ RestorePref()

override void SourceBlock.RestorePref ( )
inline

Definition at line 205 of file SourceBlock.cs.

206 {
207 foreach (Row row in rows)
208 {
209 row.pref = _rows.TryGetValue(row.id)?.pref ?? new SourcePref();
210 }
211 }

References _rows, and TileRow.id.

◆ SetRow()

override void SourceBlock.SetRow ( Row  r)
inline

Definition at line 186 of file SourceBlock.cs.

187 {
188 map[r.id] = r;
189 }

References TileRow.id.

◆ ValidatePref()

override void SourceBlock.ValidatePref ( )
inline

Definition at line 213 of file SourceBlock.cs.

214 {
215 foreach (Row row in rows)
216 {
217 row.pref.Validate();
218 }
219 }

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

Member Data Documentation

◆ _rows

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

Definition at line 106 of file SourceBlock.cs.

Referenced by BackupPref(), and RestorePref().

◆ FallbackRenderData

RenderData SourceBlock.FallbackRenderData
static

Definition at line 108 of file SourceBlock.cs.

Referenced by OnInit().

◆ RowMapping

readonly IReadOnlyDictionary<string, int> SourceBlock.RowMapping
static

Definition at line 71 of file SourceBlock.cs.

Referenced by GetRowMapping().


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