export-table-pulgin-csharp 1.0.27 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAG1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAiQpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC;AAED,eAAO,MAAM,aAAa,gBAEzB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,EAA0B,MAAM,kBAAkB,CAAA;AAG1H,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAkRpE;AAED,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,SAAW;IACf,IAAI,EAAE,MAAM,EAAE,CAAS;IAEvB,WAAW,CAAC,KAAK,EAAE,iBAAiB;CAOpC;AAED,eAAO,MAAM,aAAa,gBAEzB,CAAA"}
package/dist/index.js CHANGED
@@ -198,12 +198,12 @@ ${(0, export_table_lib_1.foreach)(fields, f => {
198
198
  ${(0, export_table_lib_1.foreach)(fields, f => {
199
199
  if (f.isUnique) {
200
200
  return `
201
- protected static Dictionary<int, ${RowClass}> _tempDictBy${convMemberName(f.name)};
202
- public static ${RowClass} GetConfigBy${convMemberName(f.name)}(int ${convMemberName(f.name)})
201
+ protected static Dictionary<${getFieldType(f)}, ${RowClass}> _tempDictBy${convMemberName(f.name)};
202
+ public static ${RowClass} GetConfigBy${convMemberName(f.name)}(${getFieldType(f)} ${convMemberName(f.name)})
203
203
  {
204
204
  if (_tempDictBy${convMemberName(f.name)} == null)
205
205
  {
206
- _tempDictBy${convMemberName(f.name)} = new Dictionary<int, ${RowClass}>();
206
+ _tempDictBy${convMemberName(f.name)} = new Dictionary<${getFieldType(f)}, ${RowClass}>();
207
207
  Configs.ForEach(c =>
208
208
  {
209
209
  _tempDictBy${convMemberName(f.name)}.Add(c.${convMemberName(f.name)}, c);
@@ -211,6 +211,24 @@ ${(0, export_table_lib_1.foreach)(fields, f => {
211
211
  }
212
212
  return _tempDictBy${convMemberName(f.name)}.GetValueOrDefault(${convMemberName(f.name)});
213
213
  }
214
+ `;
215
+ }
216
+ else if (f.type == "number" || f.type == "string") {
217
+ return `
218
+ protected static Dictionary<${getFieldType(f)}, ${RowClass}[]> _tempRecordsDictBy${convMemberName(f.name)} = new Dictionary<${getFieldType(f)}, ${RowClass}[]>();
219
+ public static ${RowClass}[] GetConfigsBy${convMemberName(f.name)}(${getFieldType(f)} ${convMemberName(f.name)})
220
+ {
221
+ if (_tempRecordsDictBy${convMemberName(f.name)}.ContainsKey(${convMemberName(f.name)}))
222
+ {
223
+ return _tempRecordsDictBy${convMemberName(f.name)}.GetValueOrDefault(${convMemberName(f.name)});
224
+ }
225
+ else
226
+ {
227
+ var records = Configs.Where(c => c.${convMemberName(f.name)} == ${convMemberName(f.name)}).ToArray();
228
+ _tempRecordsDictBy${convMemberName(f.name)}.Add(${convMemberName(f.name)}, records);
229
+ return records;
230
+ }
231
+ }
214
232
  `;
215
233
  }
216
234
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "export-table-pulgin-csharp",
3
- "version": "1.0.27",
3
+ "version": "1.0.30",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
16
  "@types/node": "^17.0.18",
17
- "export-table-lib": "^1.0.39",
17
+ "export-table-lib": "latest",
18
18
  "fs": "^0.0.1-security",
19
19
  "fs-extra": "^10.0.0",
20
20
  "fse": "^4.0.1"
package/src/index.ts CHANGED
@@ -176,12 +176,12 @@ ${foreach(fields, f => {
176
176
  ${foreach(fields, f => {
177
177
  if (f.isUnique) {
178
178
  return `
179
- protected static Dictionary<int, ${RowClass}> _tempDictBy${convMemberName(f.name)};
180
- public static ${RowClass} GetConfigBy${convMemberName(f.name)}(int ${convMemberName(f.name)})
179
+ protected static Dictionary<${getFieldType(f)}, ${RowClass}> _tempDictBy${convMemberName(f.name)};
180
+ public static ${RowClass} GetConfigBy${convMemberName(f.name)}(${getFieldType(f)} ${convMemberName(f.name)})
181
181
  {
182
182
  if (_tempDictBy${convMemberName(f.name)} == null)
183
183
  {
184
- _tempDictBy${convMemberName(f.name)} = new Dictionary<int, ${RowClass}>();
184
+ _tempDictBy${convMemberName(f.name)} = new Dictionary<${getFieldType(f)}, ${RowClass}>();
185
185
  Configs.ForEach(c =>
186
186
  {
187
187
  _tempDictBy${convMemberName(f.name)}.Add(c.${convMemberName(f.name)}, c);
@@ -189,6 +189,23 @@ ${foreach(fields, f => {
189
189
  }
190
190
  return _tempDictBy${convMemberName(f.name)}.GetValueOrDefault(${convMemberName(f.name)});
191
191
  }
192
+ `
193
+ } else if (f.type == "number" || f.type == "string") {
194
+ return `
195
+ protected static Dictionary<${getFieldType(f)}, ${RowClass}[]> _tempRecordsDictBy${convMemberName(f.name)} = new Dictionary<${getFieldType(f)}, ${RowClass}[]>();
196
+ public static ${RowClass}[] GetConfigsBy${convMemberName(f.name)}(${getFieldType(f)} ${convMemberName(f.name)})
197
+ {
198
+ if (_tempRecordsDictBy${convMemberName(f.name)}.ContainsKey(${convMemberName(f.name)}))
199
+ {
200
+ return _tempRecordsDictBy${convMemberName(f.name)}.GetValueOrDefault(${convMemberName(f.name)});
201
+ }
202
+ else
203
+ {
204
+ var records = Configs.Where(c => c.${convMemberName(f.name)} == ${convMemberName(f.name)}).ToArray();
205
+ _tempRecordsDictBy${convMemberName(f.name)}.Add(${convMemberName(f.name)}, records);
206
+ return records;
207
+ }
208
+ }
192
209
  `
193
210
  } else {
194
211
  return ""
@@ -111,13 +111,78 @@ public class 任务列表 {
111
111
  }
112
112
  return _tempDictById.GetValueOrDefault(Id);
113
113
  }
114
+ protected static Dictionary<string, 任务列表[]> _tempRecordsDictByName = new Dictionary<string, 任务列表[]>();
115
+ public static 任务列表[] GetConfigsByName(string Name)
116
+ {
117
+ if (_tempRecordsDictByName.ContainsKey(Name))
118
+ {
119
+ return _tempRecordsDictByName.GetValueOrDefault(Name);
120
+ }
121
+ else
122
+ {
123
+ var records = Configs.Where(c => c.Name == Name).ToArray();
124
+ _tempRecordsDictByName.Add(Name, records);
125
+ return records;
126
+ }
127
+ }
114
128
 
115
129
 
116
-
117
-
118
-
119
-
120
-
130
+ protected static Dictionary<string, 任务列表[]> _tempRecordsDictBy任务类型 = new Dictionary<string, 任务列表[]>();
131
+ public static 任务列表[] GetConfigsBy任务类型(string 任务类型)
132
+ {
133
+ if (_tempRecordsDictBy任务类型.ContainsKey(任务类型))
134
+ {
135
+ return _tempRecordsDictBy任务类型.GetValueOrDefault(任务类型);
136
+ }
137
+ else
138
+ {
139
+ var records = Configs.Where(c => c.任务类型 == 任务类型).ToArray();
140
+ _tempRecordsDictBy任务类型.Add(任务类型, records);
141
+ return records;
142
+ }
143
+ }
144
+ protected static Dictionary<string, 任务列表[]> _tempRecordsDictBy任务标签 = new Dictionary<string, 任务列表[]>();
145
+ public static 任务列表[] GetConfigsBy任务标签(string 任务标签)
146
+ {
147
+ if (_tempRecordsDictBy任务标签.ContainsKey(任务标签))
148
+ {
149
+ return _tempRecordsDictBy任务标签.GetValueOrDefault(任务标签);
150
+ }
151
+ else
152
+ {
153
+ var records = Configs.Where(c => c.任务标签 == 任务标签).ToArray();
154
+ _tempRecordsDictBy任务标签.Add(任务标签, records);
155
+ return records;
156
+ }
157
+ }
158
+ protected static Dictionary<string, 任务列表[]> _tempRecordsDictByStartCmds = new Dictionary<string, 任务列表[]>();
159
+ public static 任务列表[] GetConfigsByStartCmds(string StartCmds)
160
+ {
161
+ if (_tempRecordsDictByStartCmds.ContainsKey(StartCmds))
162
+ {
163
+ return _tempRecordsDictByStartCmds.GetValueOrDefault(StartCmds);
164
+ }
165
+ else
166
+ {
167
+ var records = Configs.Where(c => c.StartCmds == StartCmds).ToArray();
168
+ _tempRecordsDictByStartCmds.Add(StartCmds, records);
169
+ return records;
170
+ }
171
+ }
172
+ protected static Dictionary<string, 任务列表[]> _tempRecordsDictBySucceedCmds = new Dictionary<string, 任务列表[]>();
173
+ public static 任务列表[] GetConfigsBySucceedCmds(string SucceedCmds)
174
+ {
175
+ if (_tempRecordsDictBySucceedCmds.ContainsKey(SucceedCmds))
176
+ {
177
+ return _tempRecordsDictBySucceedCmds.GetValueOrDefault(SucceedCmds);
178
+ }
179
+ else
180
+ {
181
+ var records = Configs.Where(c => c.SucceedCmds == SucceedCmds).ToArray();
182
+ _tempRecordsDictBySucceedCmds.Add(SucceedCmds, records);
183
+ return records;
184
+ }
185
+ }
121
186
 
122
187
  #endregion uid map
123
188
 
@@ -72,8 +72,34 @@ public class 任务奖励 {
72
72
  }
73
73
  return _tempDictById.GetValueOrDefault(Id);
74
74
  }
75
-
76
-
75
+ protected static Dictionary<string, 任务奖励[]> _tempRecordsDictByProps1 = new Dictionary<string, 任务奖励[]>();
76
+ public static 任务奖励[] GetConfigsByProps1(string Props1)
77
+ {
78
+ if (_tempRecordsDictByProps1.ContainsKey(Props1))
79
+ {
80
+ return _tempRecordsDictByProps1.GetValueOrDefault(Props1);
81
+ }
82
+ else
83
+ {
84
+ var records = Configs.Where(c => c.Props1 == Props1).ToArray();
85
+ _tempRecordsDictByProps1.Add(Props1, records);
86
+ return records;
87
+ }
88
+ }
89
+ protected static Dictionary<double, 任务奖励[]> _tempRecordsDictByCount1 = new Dictionary<double, 任务奖励[]>();
90
+ public static 任务奖励[] GetConfigsByCount1(double Count1)
91
+ {
92
+ if (_tempRecordsDictByCount1.ContainsKey(Count1))
93
+ {
94
+ return _tempRecordsDictByCount1.GetValueOrDefault(Count1);
95
+ }
96
+ else
97
+ {
98
+ var records = Configs.Where(c => c.Count1 == Count1).ToArray();
99
+ _tempRecordsDictByCount1.Add(Count1, records);
100
+ return records;
101
+ }
102
+ }
77
103
 
78
104
  #endregion uid map
79
105
 
@@ -61,7 +61,20 @@ public class 任务时限 {
61
61
  }
62
62
  return _tempDictById.GetValueOrDefault(Id);
63
63
  }
64
-
64
+ protected static Dictionary<double, 任务时限[]> _tempRecordsDictByDuration = new Dictionary<double, 任务时限[]>();
65
+ public static 任务时限[] GetConfigsByDuration(double Duration)
66
+ {
67
+ if (_tempRecordsDictByDuration.ContainsKey(Duration))
68
+ {
69
+ return _tempRecordsDictByDuration.GetValueOrDefault(Duration);
70
+ }
71
+ else
72
+ {
73
+ var records = Configs.Where(c => c.Duration == Duration).ToArray();
74
+ _tempRecordsDictByDuration.Add(Duration, records);
75
+ return records;
76
+ }
77
+ }
65
78
 
66
79
  #endregion uid map
67
80
 
@@ -133,16 +133,133 @@ public class 任务触发约束配表 {
133
133
  }
134
134
  return _tempDictById.GetValueOrDefault(Id);
135
135
  }
136
+ protected static Dictionary<double, 任务触发约束配表[]> _tempRecordsDictByTaskId = new Dictionary<double, 任务触发约束配表[]>();
137
+ public static 任务触发约束配表[] GetConfigsByTaskId(double TaskId)
138
+ {
139
+ if (_tempRecordsDictByTaskId.ContainsKey(TaskId))
140
+ {
141
+ return _tempRecordsDictByTaskId.GetValueOrDefault(TaskId);
142
+ }
143
+ else
144
+ {
145
+ var records = Configs.Where(c => c.TaskId == TaskId).ToArray();
146
+ _tempRecordsDictByTaskId.Add(TaskId, records);
147
+ return records;
148
+ }
149
+ }
136
150
 
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
151
+ protected static Dictionary<string, 任务触发约束配表[]> _tempRecordsDictByCond1 = new Dictionary<string, 任务触发约束配表[]>();
152
+ public static 任务触发约束配表[] GetConfigsByCond1(string Cond1)
153
+ {
154
+ if (_tempRecordsDictByCond1.ContainsKey(Cond1))
155
+ {
156
+ return _tempRecordsDictByCond1.GetValueOrDefault(Cond1);
157
+ }
158
+ else
159
+ {
160
+ var records = Configs.Where(c => c.Cond1 == Cond1).ToArray();
161
+ _tempRecordsDictByCond1.Add(Cond1, records);
162
+ return records;
163
+ }
164
+ }
165
+ protected static Dictionary<double, 任务触发约束配表[]> _tempRecordsDictByPara1 = new Dictionary<double, 任务触发约束配表[]>();
166
+ public static 任务触发约束配表[] GetConfigsByPara1(double Para1)
167
+ {
168
+ if (_tempRecordsDictByPara1.ContainsKey(Para1))
169
+ {
170
+ return _tempRecordsDictByPara1.GetValueOrDefault(Para1);
171
+ }
172
+ else
173
+ {
174
+ var records = Configs.Where(c => c.Para1 == Para1).ToArray();
175
+ _tempRecordsDictByPara1.Add(Para1, records);
176
+ return records;
177
+ }
178
+ }
179
+ protected static Dictionary<string, 任务触发约束配表[]> _tempRecordsDictByCond2 = new Dictionary<string, 任务触发约束配表[]>();
180
+ public static 任务触发约束配表[] GetConfigsByCond2(string Cond2)
181
+ {
182
+ if (_tempRecordsDictByCond2.ContainsKey(Cond2))
183
+ {
184
+ return _tempRecordsDictByCond2.GetValueOrDefault(Cond2);
185
+ }
186
+ else
187
+ {
188
+ var records = Configs.Where(c => c.Cond2 == Cond2).ToArray();
189
+ _tempRecordsDictByCond2.Add(Cond2, records);
190
+ return records;
191
+ }
192
+ }
193
+ protected static Dictionary<double, 任务触发约束配表[]> _tempRecordsDictByPara2 = new Dictionary<double, 任务触发约束配表[]>();
194
+ public static 任务触发约束配表[] GetConfigsByPara2(double Para2)
195
+ {
196
+ if (_tempRecordsDictByPara2.ContainsKey(Para2))
197
+ {
198
+ return _tempRecordsDictByPara2.GetValueOrDefault(Para2);
199
+ }
200
+ else
201
+ {
202
+ var records = Configs.Where(c => c.Para2 == Para2).ToArray();
203
+ _tempRecordsDictByPara2.Add(Para2, records);
204
+ return records;
205
+ }
206
+ }
207
+ protected static Dictionary<string, 任务触发约束配表[]> _tempRecordsDictByCond3 = new Dictionary<string, 任务触发约束配表[]>();
208
+ public static 任务触发约束配表[] GetConfigsByCond3(string Cond3)
209
+ {
210
+ if (_tempRecordsDictByCond3.ContainsKey(Cond3))
211
+ {
212
+ return _tempRecordsDictByCond3.GetValueOrDefault(Cond3);
213
+ }
214
+ else
215
+ {
216
+ var records = Configs.Where(c => c.Cond3 == Cond3).ToArray();
217
+ _tempRecordsDictByCond3.Add(Cond3, records);
218
+ return records;
219
+ }
220
+ }
221
+ protected static Dictionary<double, 任务触发约束配表[]> _tempRecordsDictByPara3 = new Dictionary<double, 任务触发约束配表[]>();
222
+ public static 任务触发约束配表[] GetConfigsByPara3(double Para3)
223
+ {
224
+ if (_tempRecordsDictByPara3.ContainsKey(Para3))
225
+ {
226
+ return _tempRecordsDictByPara3.GetValueOrDefault(Para3);
227
+ }
228
+ else
229
+ {
230
+ var records = Configs.Where(c => c.Para3 == Para3).ToArray();
231
+ _tempRecordsDictByPara3.Add(Para3, records);
232
+ return records;
233
+ }
234
+ }
235
+ protected static Dictionary<string, 任务触发约束配表[]> _tempRecordsDictByLimit1 = new Dictionary<string, 任务触发约束配表[]>();
236
+ public static 任务触发约束配表[] GetConfigsByLimit1(string Limit1)
237
+ {
238
+ if (_tempRecordsDictByLimit1.ContainsKey(Limit1))
239
+ {
240
+ return _tempRecordsDictByLimit1.GetValueOrDefault(Limit1);
241
+ }
242
+ else
243
+ {
244
+ var records = Configs.Where(c => c.Limit1 == Limit1).ToArray();
245
+ _tempRecordsDictByLimit1.Add(Limit1, records);
246
+ return records;
247
+ }
248
+ }
249
+ protected static Dictionary<double, 任务触发约束配表[]> _tempRecordsDictByLimitPara1 = new Dictionary<double, 任务触发约束配表[]>();
250
+ public static 任务触发约束配表[] GetConfigsByLimitPara1(double LimitPara1)
251
+ {
252
+ if (_tempRecordsDictByLimitPara1.ContainsKey(LimitPara1))
253
+ {
254
+ return _tempRecordsDictByLimitPara1.GetValueOrDefault(LimitPara1);
255
+ }
256
+ else
257
+ {
258
+ var records = Configs.Where(c => c.LimitPara1 == LimitPara1).ToArray();
259
+ _tempRecordsDictByLimitPara1.Add(LimitPara1, records);
260
+ return records;
261
+ }
262
+ }
146
263
 
147
264
  #endregion uid map
148
265
 
@@ -69,8 +69,34 @@ public class Sheet2 {
69
69
  }
70
70
  return _tempDictByUid.GetValueOrDefault(Uid);
71
71
  }
72
-
73
-
72
+ protected static Dictionary<string, Sheet2[]> _tempRecordsDictBySceneId = new Dictionary<string, Sheet2[]>();
73
+ public static Sheet2[] GetConfigsBySceneId(string SceneId)
74
+ {
75
+ if (_tempRecordsDictBySceneId.ContainsKey(SceneId))
76
+ {
77
+ return _tempRecordsDictBySceneId.GetValueOrDefault(SceneId);
78
+ }
79
+ else
80
+ {
81
+ var records = Configs.Where(c => c.SceneId == SceneId).ToArray();
82
+ _tempRecordsDictBySceneId.Add(SceneId, records);
83
+ return records;
84
+ }
85
+ }
86
+ protected static Dictionary<double, Sheet2[]> _tempRecordsDictByOutingBaseGold = new Dictionary<double, Sheet2[]>();
87
+ public static Sheet2[] GetConfigsByOutingBaseGold(double OutingBaseGold)
88
+ {
89
+ if (_tempRecordsDictByOutingBaseGold.ContainsKey(OutingBaseGold))
90
+ {
91
+ return _tempRecordsDictByOutingBaseGold.GetValueOrDefault(OutingBaseGold);
92
+ }
93
+ else
94
+ {
95
+ var records = Configs.Where(c => c.OutingBaseGold == OutingBaseGold).ToArray();
96
+ _tempRecordsDictByOutingBaseGold.Add(OutingBaseGold, records);
97
+ return records;
98
+ }
99
+ }
74
100
 
75
101
  #endregion uid map
76
102
 
@@ -69,8 +69,34 @@ public class SceneConfig {
69
69
  }
70
70
  return _tempDictByUid.GetValueOrDefault(Uid);
71
71
  }
72
-
73
-
72
+ protected static Dictionary<string, SceneConfig[]> _tempRecordsDictBySceneId = new Dictionary<string, SceneConfig[]>();
73
+ public static SceneConfig[] GetConfigsBySceneId(string SceneId)
74
+ {
75
+ if (_tempRecordsDictBySceneId.ContainsKey(SceneId))
76
+ {
77
+ return _tempRecordsDictBySceneId.GetValueOrDefault(SceneId);
78
+ }
79
+ else
80
+ {
81
+ var records = Configs.Where(c => c.SceneId == SceneId).ToArray();
82
+ _tempRecordsDictBySceneId.Add(SceneId, records);
83
+ return records;
84
+ }
85
+ }
86
+ protected static Dictionary<double, SceneConfig[]> _tempRecordsDictByOutingBaseGold = new Dictionary<double, SceneConfig[]>();
87
+ public static SceneConfig[] GetConfigsByOutingBaseGold(double OutingBaseGold)
88
+ {
89
+ if (_tempRecordsDictByOutingBaseGold.ContainsKey(OutingBaseGold))
90
+ {
91
+ return _tempRecordsDictByOutingBaseGold.GetValueOrDefault(OutingBaseGold);
92
+ }
93
+ else
94
+ {
95
+ var records = Configs.Where(c => c.OutingBaseGold == OutingBaseGold).ToArray();
96
+ _tempRecordsDictByOutingBaseGold.Add(OutingBaseGold, records);
97
+ return records;
98
+ }
99
+ }
74
100
 
75
101
  #endregion uid map
76
102