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