Elin Decompiled Documentation EA 23.321 Nightly Patch 1
Loading...
Searching...
No Matches
SourceJob.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
4public class SourceJob : SourceDataString<SourceJob.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 playable;
16
17 public int STR;
18
19 public int END;
20
21 public int DEX;
22
23 public int PER;
24
25 public int LER;
26
27 public int WIL;
28
29 public int MAG;
30
31 public int CHA;
32
33 public int SPD;
34
35 public int[] elements;
36
37 public string[] weapon;
38
39 public string equip;
40
41 public int[] domain;
42
43 public string detail_JP;
44
45 public string detail;
46
47 public Dictionary<int, int> elementMap;
48
49 [NonSerialized]
50 public string name_L;
51
52 [NonSerialized]
53 public string detail_L;
54
55 public override bool UseAlias => false;
56
57 public override string GetAlias => "n";
58
59 public void WriteNote(UINote n)
60 {
61 n.Clear();
62 n.AddHeader(GetName().ToTitleCase());
63 n.AddText(GetDetail()).SetWidth(400);
64 n.Build();
65 }
66 }
67
68 public static readonly IReadOnlyDictionary<string, int> RowMapping = new Dictionary<string, int>
69 {
70 ["id"] = 0,
71 ["name_JP"] = 1,
72 ["name"] = 2,
73 ["playable"] = 3,
74 ["STR"] = 4,
75 ["END"] = 5,
76 ["DEX"] = 6,
77 ["PER"] = 7,
78 ["LER"] = 8,
79 ["WIL"] = 9,
80 ["MAG"] = 10,
81 ["CHA"] = 11,
82 ["SPD"] = 12,
83 ["elements"] = 14,
84 ["weapon"] = 15,
85 ["equip"] = 16,
86 ["domain"] = 17,
87 ["detail_JP"] = 18,
88 ["detail"] = 19
89 };
90
91 public static readonly IReadOnlyDictionary<string, string> TypeMapping = new Dictionary<string, string>
92 {
93 ["id"] = "string",
94 ["name_JP"] = "string",
95 ["name"] = "string",
96 ["playable"] = "int",
97 ["STR"] = "int",
98 ["END"] = "int",
99 ["DEX"] = "int",
100 ["PER"] = "int",
101 ["LER"] = "int",
102 ["WIL"] = "int",
103 ["MAG"] = "int",
104 ["CHA"] = "int",
105 ["SPD"] = "int",
106 ["elements"] = "elements",
107 ["weapon"] = "string[]",
108 ["equip"] = "string",
109 ["domain"] = "elements",
110 ["detail_JP"] = "string",
111 ["detail"] = "string"
112 };
113
114 public override Row CreateRow()
115 {
116 return new Row
117 {
118 id = SourceData.GetString(0),
119 name_JP = SourceData.GetString(1),
120 name = SourceData.GetString(2),
121 playable = SourceData.GetInt(3),
122 STR = SourceData.GetInt(4),
123 END = SourceData.GetInt(5),
124 DEX = SourceData.GetInt(6),
125 PER = SourceData.GetInt(7),
126 LER = SourceData.GetInt(8),
127 WIL = SourceData.GetInt(9),
128 MAG = SourceData.GetInt(10),
129 CHA = SourceData.GetInt(11),
130 SPD = SourceData.GetInt(12),
131 elements = Core.ParseElements(SourceData.GetStr(14)),
133 equip = SourceData.GetString(16),
134 domain = Core.ParseElements(SourceData.GetStr(17)),
135 detail_JP = SourceData.GetString(18),
136 detail = SourceData.GetString(19)
137 };
138 }
139
140 public override Row CreateRowByMapping(IReadOnlyDictionary<string, int> mapping)
141 {
142 return new Row
143 {
144 id = SourceData.GetString(mapping["id"]),
145 name_JP = SourceData.GetString(mapping["name_JP"]),
146 name = SourceData.GetString(mapping["name"]),
147 playable = SourceData.GetInt(mapping["playable"]),
148 STR = SourceData.GetInt(mapping["STR"]),
149 END = SourceData.GetInt(mapping["END"]),
150 DEX = SourceData.GetInt(mapping["DEX"]),
151 PER = SourceData.GetInt(mapping["PER"]),
152 LER = SourceData.GetInt(mapping["LER"]),
153 WIL = SourceData.GetInt(mapping["WIL"]),
154 MAG = SourceData.GetInt(mapping["MAG"]),
155 CHA = SourceData.GetInt(mapping["CHA"]),
156 SPD = SourceData.GetInt(mapping["SPD"]),
157 elements = Core.ParseElements(SourceData.GetStr(mapping["elements"])),
158 weapon = SourceData.GetStringArray(mapping["weapon"]),
159 equip = SourceData.GetString(mapping["equip"]),
160 domain = Core.ParseElements(SourceData.GetStr(mapping["domain"])),
161 detail_JP = SourceData.GetString(mapping["detail_JP"]),
162 detail = SourceData.GetString(mapping["detail"])
163 };
164 }
165
166 public override void SetRow(Row r)
167 {
168 map[r.id] = r;
169 }
170
171 public override IReadOnlyDictionary<string, int> GetRowMapping()
172 {
173 return RowMapping;
174 }
175
176 public override IReadOnlyDictionary<string, string> GetTypeMapping()
177 {
178 return TypeMapping;
179 }
180
181 public override void OnInit()
182 {
183 foreach (Row row in rows)
184 {
185 Dictionary<int, int> dictionary = (row.elementMap = Element.GetElementMap(row.elements));
186 dictionary[70] = row.STR;
187 dictionary[71] = row.END;
188 dictionary[72] = row.DEX;
189 dictionary[73] = row.PER;
190 dictionary[74] = row.LER;
191 dictionary[75] = row.WIL;
192 dictionary[76] = row.MAG;
193 dictionary[77] = row.CHA;
194 dictionary[79] = row.SPD;
195 }
196 }
197}
Definition: Core.cs:14
static int[] ParseElements(string str)
Definition: Core.cs:726
static Dictionary< int, int > GetElementMap(int[] list)
Definition: ELEMENT.cs:538
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 string GetStr(int id, bool useDefault=false)
Definition: SourceData.cs:1021
string detail
Definition: SourceJob.cs:45
void WriteNote(UINote n)
Definition: SourceJob.cs:59
string[] weapon
Definition: SourceJob.cs:37
string equip
Definition: SourceJob.cs:39
string detail_JP
Definition: SourceJob.cs:43
int[] elements
Definition: SourceJob.cs:35
string name
Definition: SourceJob.cs:13
Dictionary< int, int > elementMap
Definition: SourceJob.cs:47
string detail_L
Definition: SourceJob.cs:53
string id
Definition: SourceJob.cs:9
string name_L
Definition: SourceJob.cs:50
int[] domain
Definition: SourceJob.cs:41
override bool UseAlias
Definition: SourceJob.cs:55
override string GetAlias
Definition: SourceJob.cs:57
string name_JP
Definition: SourceJob.cs:11
override Row CreateRow()
Definition: SourceJob.cs:114
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceJob.cs:68
override IReadOnlyDictionary< string, int > GetRowMapping()
Definition: SourceJob.cs:171
override void SetRow(Row r)
Definition: SourceJob.cs:166
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceJob.cs:91
override Row CreateRowByMapping(IReadOnlyDictionary< string, int > mapping)
Definition: SourceJob.cs:140
override IReadOnlyDictionary< string, string > GetTypeMapping()
Definition: SourceJob.cs:176
override void OnInit()
Definition: SourceJob.cs:181
void SetWidth(int w)
Definition: UIItem.cs:38
Definition: UINote.cs:6
void Clear()
Definition: UINote.cs:35
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49