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