Elin Decompiled Documentation EA 23.316 Nightly
Loading...
Searching...
No Matches
SourceHomeResource.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
4public class SourceHomeResource : SourceDataString<SourceHomeResource.Row>
5{
6 [Serializable]
7 public class Row : BaseRow
8 {
9 public string id;
10
11 public string name_JP;
12
13 public string name;
14
15 public int expMod;
16
17 public int maxLv;
18
19 public string[] reward;
20
21 public string detail_JP;
22
23 public string detail;
24
25 [NonSerialized]
26 public string name_L;
27
28 [NonSerialized]
29 public string detail_L;
30
31 public override bool UseAlias => false;
32
33 public override string GetAlias => "n";
34 }
35
36 public static readonly IReadOnlyDictionary<string, int> RowMapping = new Dictionary<string, int>
37 {
38 ["id"] = 0,
39 ["name_JP"] = 1,
40 ["name"] = 2,
41 ["expMod"] = 3,
42 ["maxLv"] = 4,
43 ["reward"] = 5,
44 ["detail_JP"] = 6,
45 ["detail"] = 7
46 };
47
48 public static readonly IReadOnlyDictionary<string, string> TypeMapping = new Dictionary<string, string>
49 {
50 ["id"] = "string",
51 ["name_JP"] = "string",
52 ["name"] = "string",
53 ["expMod"] = "int",
54 ["maxLv"] = "int",
55 ["reward"] = "string[]",
56 ["detail_JP"] = "string",
57 ["detail"] = "string"
58 };
59
60 public override Row CreateRow()
61 {
62 return new Row
63 {
64 id = SourceData.GetString(0),
65 name_JP = SourceData.GetString(1),
66 name = SourceData.GetString(2),
67 expMod = SourceData.GetInt(3),
68 maxLv = SourceData.GetInt(4),
69 reward = SourceData.GetStringArray(5),
70 detail_JP = SourceData.GetString(6),
71 detail = SourceData.GetString(7)
72 };
73 }
74
75 public override Row CreateRowByMapping(IReadOnlyDictionary<string, int> mapping)
76 {
77 return new Row
78 {
79 id = SourceData.GetString(mapping["id"]),
80 name_JP = SourceData.GetString(mapping["name_JP"]),
81 name = SourceData.GetString(mapping["name"]),
82 expMod = SourceData.GetInt(mapping["expMod"]),
83 maxLv = SourceData.GetInt(mapping["maxLv"]),
84 reward = SourceData.GetStringArray(mapping["reward"]),
85 detail_JP = SourceData.GetString(mapping["detail_JP"]),
86 detail = SourceData.GetString(mapping["detail"])
87 };
88 }
89
90 public override void SetRow(Row r)
91 {
92 map[r.id] = r;
93 }
94
95 public override IReadOnlyDictionary<string, int> GetRowMapping()
96 {
97 return RowMapping;
98 }
99
100 public override IReadOnlyDictionary<string, string> GetTypeMapping()
101 {
102 return TypeMapping;
103 }
104}
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
override Row CreateRow()
static readonly IReadOnlyDictionary< string, int > RowMapping
override void SetRow(Row r)
override IReadOnlyDictionary< string, int > GetRowMapping()
override IReadOnlyDictionary< string, string > GetTypeMapping()
static readonly IReadOnlyDictionary< string, string > TypeMapping
override Row CreateRowByMapping(IReadOnlyDictionary< string, int > mapping)