export-table-pulgin-csharp 1.0.16 → 1.0.19
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -11
- package/package.json +3 -3
- package/src/index.ts +71 -3
- package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-TaskConfig.cs +135 -0
- package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-TaskRewards.cs +68 -0
- package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-TaskTriggerConfig.cs +145 -0
- package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-TimeLimit.cs +55 -0
- package/test/dist/{SceneConfig.csx → SceneConfig-Sheet2.cs} +24 -14
- package/test/dist/SceneConfig.cs +15 -5
- package/test/src/EGBL/344/273/273/345/212/241/351/205/215/347/275/256.xlsx +0 -0
- package/test/test.bat +1 -1
- package/test/dist/SceneConfig.csharp +0 -0
- package/test/dist/Sheet2.csharp +0 -0
- package/test/dist/table.csharp +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HandleSheetParams, PluginBase } from "
|
|
1
|
+
import { HandleSheetParams, PluginBase } from "export-table-lib";
|
|
2
2
|
export declare function export_stuff(paras: HandleSheetParams): string | null;
|
|
3
3
|
export declare class ExportPlugin extends PluginBase {
|
|
4
4
|
name: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,iBAAiB,EAA+B,UAAU,
|
|
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,CAqOpE;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
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.ExportPlugins = exports.ExportPlugin = exports.export_stuff = void 0;
|
|
27
|
-
const
|
|
27
|
+
const export_table_lib_1 = require("export-table-lib");
|
|
28
28
|
const fs = __importStar(require("fs-extra"));
|
|
29
29
|
function export_stuff(paras) {
|
|
30
30
|
let { datas, fields, inject, name, objects, packagename, tables, xxtea, } = paras;
|
|
@@ -76,6 +76,7 @@ function export_stuff(paras) {
|
|
|
76
76
|
return "int[]";
|
|
77
77
|
}
|
|
78
78
|
else if (t == "any") {
|
|
79
|
+
console.log(f);
|
|
79
80
|
throw new Error(`invalid type ${f.name}:<any>`);
|
|
80
81
|
}
|
|
81
82
|
else if (t == "key") {
|
|
@@ -86,6 +87,9 @@ function export_stuff(paras) {
|
|
|
86
87
|
}
|
|
87
88
|
return t;
|
|
88
89
|
};
|
|
90
|
+
let getFkFieldType = function (field) {
|
|
91
|
+
return tables.find(a => a.name == field.fkTableName).fields.find(a => a.name == field.fkFieldName).type;
|
|
92
|
+
};
|
|
89
93
|
const genValue = (value, f) => {
|
|
90
94
|
let t = f.type;
|
|
91
95
|
if (t == "object") {
|
|
@@ -126,6 +130,7 @@ function export_stuff(paras) {
|
|
|
126
130
|
return `new int[]{${values.join(", ")}}`;
|
|
127
131
|
}
|
|
128
132
|
else if (t == "any") {
|
|
133
|
+
console.log(f);
|
|
129
134
|
throw new Error(`invalid type ${f.name}:<any>`);
|
|
130
135
|
}
|
|
131
136
|
else if (t == "key") {
|
|
@@ -141,23 +146,24 @@ function export_stuff(paras) {
|
|
|
141
146
|
};
|
|
142
147
|
let temp = `
|
|
143
148
|
using System.Collections.Generic;
|
|
149
|
+
using System.Linq;
|
|
144
150
|
|
|
145
151
|
public class ${RowClass} {
|
|
146
152
|
|
|
147
153
|
public static List<${RowClass}> Configs = new List<${RowClass}>()
|
|
148
154
|
{
|
|
149
|
-
${(0,
|
|
155
|
+
${(0, export_table_lib_1.foreach)(datas, data => ` new ${RowClass}(${(0, export_table_lib_1.st)(() => fields.map((f, index) => genValue(data[index], f)).join(", "))}),`)}
|
|
150
156
|
};
|
|
151
157
|
|
|
152
158
|
public ${RowClass}() { }
|
|
153
|
-
public ${RowClass}(${(0,
|
|
159
|
+
public ${RowClass}(${(0, export_table_lib_1.st)(() => fields.map(f => `${getFieldType(f)} ${convVarName(f.name)}`).join(", "))})
|
|
154
160
|
{
|
|
155
|
-
${(0,
|
|
161
|
+
${(0, export_table_lib_1.foreach)(fields, f => ` this.${convMemberName(f.name)} = ${convVarName(f.name)};`)}
|
|
156
162
|
}
|
|
157
163
|
|
|
158
164
|
public virtual ${RowClass} MergeFrom(${RowClass} source)
|
|
159
165
|
{
|
|
160
|
-
${(0,
|
|
166
|
+
${(0, export_table_lib_1.foreach)(fields, f => ` this.${convMemberName(f.name)} = source.${convMemberName(f.name)};`)}
|
|
161
167
|
return this;
|
|
162
168
|
}
|
|
163
169
|
|
|
@@ -168,23 +174,86 @@ ${(0, windy_quicktable_1.foreach)(fields, f => ` this.${convMemberName(f.name)}
|
|
|
168
174
|
return config;
|
|
169
175
|
}
|
|
170
176
|
|
|
171
|
-
${(0,
|
|
172
|
-
${(0,
|
|
177
|
+
${(0, export_table_lib_1.cmm)( /**生成字段 */)}
|
|
178
|
+
${(0, export_table_lib_1.foreach)(fields, f => `
|
|
173
179
|
/// <summary>
|
|
174
|
-
${(0,
|
|
180
|
+
${(0, export_table_lib_1.foreach)(getDescripts(f), line => ` /// ${line}`)}
|
|
175
181
|
/// </summary>
|
|
176
182
|
public ${getFieldType(f)} ${convMemberName(f.name)};`)}
|
|
177
183
|
|
|
178
|
-
${(0,
|
|
184
|
+
${(0, export_table_lib_1.cmm)( /**生成get字段 */)}
|
|
179
185
|
#region get字段
|
|
180
|
-
${(0,
|
|
186
|
+
${(0, export_table_lib_1.foreach)(fields, f => {
|
|
187
|
+
if (f.nameOrigin != f.name) {
|
|
188
|
+
return ` public ${getFieldType(f)} ${getTitle(f).replace(" ", "_")} => ${convMemberName(f.name)};`;
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return "";
|
|
192
|
+
}
|
|
193
|
+
})}
|
|
181
194
|
#endregion
|
|
195
|
+
|
|
196
|
+
#region 生成fk.get/set
|
|
197
|
+
${(0, export_table_lib_1.foreach)(fields, f => `
|
|
198
|
+
${(0, export_table_lib_1.iff)(f.type == "fk", () => `
|
|
199
|
+
${(0, export_table_lib_1.iff)(getFkFieldType(f).toLowerCase() != "uid", () => `
|
|
200
|
+
protected ${convMemberName(f.fkTableName)}[] _fk${convMemberName(f.name)}=null;
|
|
201
|
+
/**
|
|
202
|
+
* ${f.describe}
|
|
203
|
+
**/
|
|
204
|
+
public virtual ${convMemberName(f.fkTableName)}[] ${convMemberName(f.name)}DataList{
|
|
205
|
+
get{
|
|
206
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
207
|
+
if(null==this.${convMemberName(f.name)}){
|
|
208
|
+
this._fk${convMemberName(f.name)} = new ${convMemberName(f.fkTableName)}[0];
|
|
209
|
+
}else{
|
|
210
|
+
this._fk${convMemberName(f.name)}=${convMemberName(f.fkTableName)}.FindAll(a=>a.${convMemberName(f.fkFieldName)}!=null && this.${convMemberName(f.name)}==a.${convMemberName(f.fkFieldName)}).ToArray();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return this._fk${convMemberName(f.name)};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`).else(() => `
|
|
217
|
+
protected ${convMemberName(f.fkTableName)} _fk${convMemberName(f.name)}=null;
|
|
218
|
+
/**
|
|
219
|
+
* ${f.describe}
|
|
220
|
+
**/
|
|
221
|
+
public virtual ${convMemberName(f.fkTableName)} ${convMemberName(f.name)}Data{
|
|
222
|
+
get{
|
|
223
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
224
|
+
this._fk${convMemberName(f.name)}=${convMemberName(f.fkTableName)}.Find(a=>a.${convMemberName(f.fkFieldName)}==this.${convMemberName(f.name)});
|
|
225
|
+
}
|
|
226
|
+
return this._fk${convMemberName(f.name)};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
`)}
|
|
230
|
+
`)}
|
|
231
|
+
${(0, export_table_lib_1.iff)(f.type == "fk[]", () => `
|
|
232
|
+
protected ${convMemberName(f.fkTableName)}[] _fk${convMemberName(f.name)}=null;
|
|
233
|
+
/**
|
|
234
|
+
* ${f.describe}
|
|
235
|
+
**/
|
|
236
|
+
public virtual ${convMemberName(f.fkTableName)}[] ${convMemberName(f.name)}DataList{
|
|
237
|
+
get{
|
|
238
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
239
|
+
if(null==this.${convMemberName(f.name)}){
|
|
240
|
+
this._fk${convMemberName(f.name)} = new ${convMemberName(f.fkTableName)}[0];
|
|
241
|
+
}else{
|
|
242
|
+
this._fk${convMemberName(f.name)}=global::${convMemberName(f.fkTableName)}.Configs.FindAll(a=>a.${convMemberName(f.fkFieldName)}!=null && this.${convMemberName(f.name)}!.Contains(a.${convMemberName(f.fkFieldName)})).ToArray();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return this._fk${convMemberName(f.name)};
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
`)}
|
|
249
|
+
`)}
|
|
250
|
+
#endregion 生成fk.get/set
|
|
182
251
|
}
|
|
183
252
|
`;
|
|
184
253
|
return temp;
|
|
185
254
|
}
|
|
186
255
|
exports.export_stuff = export_stuff;
|
|
187
|
-
class ExportPlugin extends
|
|
256
|
+
class ExportPlugin extends export_table_lib_1.PluginBase {
|
|
188
257
|
constructor() {
|
|
189
258
|
super(...arguments);
|
|
190
259
|
this.name = "csharp";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "export-table-pulgin-csharp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@types/node": "^17.0.18",
|
|
17
|
+
"export-table-lib": "^1.0.38",
|
|
17
18
|
"fs": "^0.0.1-security",
|
|
18
19
|
"fs-extra": "^10.0.0",
|
|
19
|
-
"fse": "^4.0.1"
|
|
20
|
-
"windy-quicktable": "^1.3.34"
|
|
20
|
+
"fse": "^4.0.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/fs-extra": "^9.0.13"
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, HandleBatchParams } from "
|
|
2
|
+
import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, HandleBatchParams, iff } from "export-table-lib"
|
|
3
3
|
import * as fs from "fs-extra"
|
|
4
4
|
|
|
5
5
|
export function export_stuff(paras: HandleSheetParams): string | null {
|
|
@@ -53,6 +53,7 @@ export function export_stuff(paras: HandleSheetParams): string | null {
|
|
|
53
53
|
} else if (t == "fk[]") {
|
|
54
54
|
return "int[]";
|
|
55
55
|
} else if (t == "any") {
|
|
56
|
+
console.log(f)
|
|
56
57
|
throw new Error(`invalid type ${f.name}:<any>`)
|
|
57
58
|
} else if (t == "key") {
|
|
58
59
|
return "string";
|
|
@@ -62,6 +63,10 @@ export function export_stuff(paras: HandleSheetParams): string | null {
|
|
|
62
63
|
return t;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
let getFkFieldType = function (field: Field) {
|
|
67
|
+
return tables.find(a => a.name == field.fkTableName)!.fields!.find(a => a.name == field.fkFieldName)!.type
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
const genValue = (value: any, f: Field): string => {
|
|
66
71
|
let t = f.type
|
|
67
72
|
if (t == "object") {
|
|
@@ -91,6 +96,7 @@ export function export_stuff(paras: HandleSheetParams): string | null {
|
|
|
91
96
|
let values = value as number[]
|
|
92
97
|
return `new int[]{${values.join(", ")}}`
|
|
93
98
|
} else if (t == "any") {
|
|
99
|
+
console.log(f)
|
|
94
100
|
throw new Error(`invalid type ${f.name}:<any>`)
|
|
95
101
|
} else if (t == "key") {
|
|
96
102
|
return `${value}`
|
|
@@ -109,6 +115,7 @@ export function export_stuff(paras: HandleSheetParams): string | null {
|
|
|
109
115
|
|
|
110
116
|
let temp = `
|
|
111
117
|
using System.Collections.Generic;
|
|
118
|
+
using System.Linq;
|
|
112
119
|
|
|
113
120
|
public class ${RowClass} {
|
|
114
121
|
|
|
@@ -154,10 +161,71 @@ ${foreach(getDescripts(f), line =>
|
|
|
154
161
|
|
|
155
162
|
${cmm(/**生成get字段 */)}
|
|
156
163
|
#region get字段
|
|
157
|
-
${foreach(fields, f =>
|
|
158
|
-
|
|
164
|
+
${foreach(fields, f => {
|
|
165
|
+
if (f.nameOrigin != f.name) {
|
|
166
|
+
return ` public ${getFieldType(f)} ${getTitle(f).replace(" ", "_")} => ${convMemberName(f.name)};`
|
|
167
|
+
} else {
|
|
168
|
+
return ""
|
|
169
|
+
}
|
|
170
|
+
}
|
|
159
171
|
)}
|
|
160
172
|
#endregion
|
|
173
|
+
|
|
174
|
+
#region 生成fk.get/set
|
|
175
|
+
${foreach(fields, f => `
|
|
176
|
+
${iff(f.type == "fk", () => `
|
|
177
|
+
${iff(getFkFieldType(f).toLowerCase() != "uid", () => `
|
|
178
|
+
protected ${convMemberName(f.fkTableName!)}[] _fk${convMemberName(f.name)}=null;
|
|
179
|
+
/**
|
|
180
|
+
* ${f.describe}
|
|
181
|
+
**/
|
|
182
|
+
public virtual ${convMemberName(f.fkTableName!)}[] ${convMemberName(f.name)}DataList{
|
|
183
|
+
get{
|
|
184
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
185
|
+
if(null==this.${convMemberName(f.name)}){
|
|
186
|
+
this._fk${convMemberName(f.name)} = new ${convMemberName(f.fkTableName!)}[0];
|
|
187
|
+
}else{
|
|
188
|
+
this._fk${convMemberName(f.name)}=${convMemberName(f.fkTableName!)}.FindAll(a=>a.${convMemberName(f.fkFieldName!)}!=null && this.${convMemberName(f.name)}==a.${convMemberName(f.fkFieldName!)}).ToArray();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return this._fk${convMemberName(f.name)};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`).else(() => `
|
|
195
|
+
protected ${convMemberName(f.fkTableName!)} _fk${convMemberName(f.name)}=null;
|
|
196
|
+
/**
|
|
197
|
+
* ${f.describe}
|
|
198
|
+
**/
|
|
199
|
+
public virtual ${convMemberName(f.fkTableName!)} ${convMemberName(f.name)}Data{
|
|
200
|
+
get{
|
|
201
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
202
|
+
this._fk${convMemberName(f.name)}=${convMemberName(f.fkTableName!)}.Find(a=>a.${convMemberName(f.fkFieldName!)}==this.${convMemberName(f.name)});
|
|
203
|
+
}
|
|
204
|
+
return this._fk${convMemberName(f.name)};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
`)}
|
|
208
|
+
`)}
|
|
209
|
+
${iff(f.type == "fk[]", () => `
|
|
210
|
+
protected ${convMemberName(f.fkTableName!)}[] _fk${convMemberName(f.name)}=null;
|
|
211
|
+
/**
|
|
212
|
+
* ${f.describe}
|
|
213
|
+
**/
|
|
214
|
+
public virtual ${convMemberName(f.fkTableName!)}[] ${convMemberName(f.name)}DataList{
|
|
215
|
+
get{
|
|
216
|
+
if(this._fk${convMemberName(f.name)}==null){
|
|
217
|
+
if(null==this.${convMemberName(f.name)}){
|
|
218
|
+
this._fk${convMemberName(f.name)} = new ${convMemberName(f.fkTableName!)}[0];
|
|
219
|
+
}else{
|
|
220
|
+
this._fk${convMemberName(f.name)}=global::${convMemberName(f.fkTableName!)}.Configs.FindAll(a=>a.${convMemberName(f.fkFieldName!)}!=null && this.${convMemberName(f.name)}!.Contains(a.${convMemberName(f.fkFieldName!)})).ToArray();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return this._fk${convMemberName(f.name)};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
`)}
|
|
227
|
+
`)}
|
|
228
|
+
#endregion 生成fk.get/set
|
|
161
229
|
}
|
|
162
230
|
`
|
|
163
231
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
|
|
5
|
+
public class TaskConfig {
|
|
6
|
+
|
|
7
|
+
public static List<TaskConfig> Configs = new List<TaskConfig>()
|
|
8
|
+
{
|
|
9
|
+
new TaskConfig(50000, "口腔", new double[]{}, new int[]{}, "", "", "`/tp @e[type=npc,c=1,tag=消化NPC] 24 47 -171`", ""),
|
|
10
|
+
new TaskConfig(50010, "食道和胃", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成口腔关卡`,`/give @p myitem:xhdlxj_modle_kouqiang`"),
|
|
11
|
+
new TaskConfig(50020, "小肠", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成食道&胃关卡`,`/give @p myitem:xhdlxj_modle_shiguan`,`/give @p myitem:xhdlxj_modle_wei`"),
|
|
12
|
+
new TaskConfig(50030, "大肠", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成小肠关卡`"),
|
|
13
|
+
new TaskConfig(50040, "消化拼图", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成大肠关卡`,`/give @p myitem:xhdlxj_modle_xiaochang`,`/give @p myitem:xhdlxj_modle_dachang`"),
|
|
14
|
+
new TaskConfig(50050, "恭喜完成", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成课程内容`"),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
public TaskConfig() { }
|
|
18
|
+
public TaskConfig(int id, string name, double[] subTasks, int[] taskRewards, string 任务类型, string 任务标签, string startCmds, string succeedCmds)
|
|
19
|
+
{
|
|
20
|
+
this.Id = id;
|
|
21
|
+
this.Name = name;
|
|
22
|
+
this.SubTasks = subTasks;
|
|
23
|
+
this.TaskRewards = taskRewards;
|
|
24
|
+
this.任务类型 = 任务类型;
|
|
25
|
+
this.任务标签 = 任务标签;
|
|
26
|
+
this.StartCmds = startCmds;
|
|
27
|
+
this.SucceedCmds = succeedCmds;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public virtual TaskConfig MergeFrom(TaskConfig source)
|
|
31
|
+
{
|
|
32
|
+
this.Id = source.Id;
|
|
33
|
+
this.Name = source.Name;
|
|
34
|
+
this.SubTasks = source.SubTasks;
|
|
35
|
+
this.TaskRewards = source.TaskRewards;
|
|
36
|
+
this.任务类型 = source.任务类型;
|
|
37
|
+
this.任务标签 = source.任务标签;
|
|
38
|
+
this.StartCmds = source.StartCmds;
|
|
39
|
+
this.SucceedCmds = source.SucceedCmds;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public virtual TaskConfig Clone()
|
|
44
|
+
{
|
|
45
|
+
var config = new TaskConfig();
|
|
46
|
+
config.MergeFrom(this);
|
|
47
|
+
return config;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// 任务ID
|
|
53
|
+
/// </summary>
|
|
54
|
+
public int Id;
|
|
55
|
+
/// <summary>
|
|
56
|
+
/// 任务名称
|
|
57
|
+
/// </summary>
|
|
58
|
+
public string Name;
|
|
59
|
+
/// <summary>
|
|
60
|
+
/// 子任务
|
|
61
|
+
/// </summary>
|
|
62
|
+
public double[] SubTasks;
|
|
63
|
+
/// <summary>
|
|
64
|
+
/// 奖励物品
|
|
65
|
+
/// wilwin wilwin:
|
|
66
|
+
/// 可配置多个,符号 ";" 号分割
|
|
67
|
+
/// 1001;1002;1003
|
|
68
|
+
/// </summary>
|
|
69
|
+
public int[] TaskRewards;
|
|
70
|
+
/// <summary>
|
|
71
|
+
/// 任务类型(客户端展示分类)
|
|
72
|
+
/// </summary>
|
|
73
|
+
public string 任务类型;
|
|
74
|
+
/// <summary>
|
|
75
|
+
/// 任务标签(客户端展示)
|
|
76
|
+
/// </summary>
|
|
77
|
+
public string 任务标签;
|
|
78
|
+
/// <summary>
|
|
79
|
+
/// 任务开始执行命令
|
|
80
|
+
/// </summary>
|
|
81
|
+
public string StartCmds;
|
|
82
|
+
/// <summary>
|
|
83
|
+
/// 任务成功执行命令
|
|
84
|
+
/// </summary>
|
|
85
|
+
public string SucceedCmds;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
#region get字段
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
#endregion
|
|
98
|
+
|
|
99
|
+
#region 生成fk.get/set
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
protected TaskRewards[] _fkTaskRewards=null;
|
|
108
|
+
/**
|
|
109
|
+
* 奖励物品
|
|
110
|
+
wilwin wilwin:
|
|
111
|
+
可配置多个,符号 ";" 号分割
|
|
112
|
+
1001;1002;1003
|
|
113
|
+
**/
|
|
114
|
+
public virtual TaskRewards[] TaskRewardsDataList{
|
|
115
|
+
get{
|
|
116
|
+
if(this._fkTaskRewards==null){
|
|
117
|
+
if(null==this.TaskRewards){
|
|
118
|
+
this._fkTaskRewards = new TaskRewards[0];
|
|
119
|
+
}else{
|
|
120
|
+
this._fkTaskRewards=global::TaskRewards.Configs.FindAll(a=>a.Id!=null && this.TaskRewards!.Contains(a.Id)).ToArray();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return this._fkTaskRewards;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
#endregion 生成fk.get/set
|
|
135
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
|
|
5
|
+
public class TaskRewards {
|
|
6
|
+
|
|
7
|
+
public static List<TaskRewards> Configs = new List<TaskRewards>()
|
|
8
|
+
{
|
|
9
|
+
new TaskRewards(1001, "apple", 1),
|
|
10
|
+
new TaskRewards(1002, "apple", 1),
|
|
11
|
+
new TaskRewards(1003, "apple", 1),
|
|
12
|
+
new TaskRewards(1004, "apple", 1),
|
|
13
|
+
new TaskRewards(1005, "apple", 1),
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
public TaskRewards() { }
|
|
17
|
+
public TaskRewards(int id, string props1, double count1)
|
|
18
|
+
{
|
|
19
|
+
this.Id = id;
|
|
20
|
+
this.Props1 = props1;
|
|
21
|
+
this.Count1 = count1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public virtual TaskRewards MergeFrom(TaskRewards source)
|
|
25
|
+
{
|
|
26
|
+
this.Id = source.Id;
|
|
27
|
+
this.Props1 = source.Props1;
|
|
28
|
+
this.Count1 = source.Count1;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public virtual TaskRewards Clone()
|
|
33
|
+
{
|
|
34
|
+
var config = new TaskRewards();
|
|
35
|
+
config.MergeFrom(this);
|
|
36
|
+
return config;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
/// 奖励ID
|
|
42
|
+
/// </summary>
|
|
43
|
+
public int Id;
|
|
44
|
+
/// <summary>
|
|
45
|
+
/// 道具1
|
|
46
|
+
/// </summary>
|
|
47
|
+
public string Props1;
|
|
48
|
+
/// <summary>
|
|
49
|
+
/// 数量1
|
|
50
|
+
/// </summary>
|
|
51
|
+
public double Count1;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#region get字段
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#endregion
|
|
59
|
+
|
|
60
|
+
#region 生成fk.get/set
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
#endregion 生成fk.get/set
|
|
68
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
|
|
5
|
+
public class TaskTriggerConfig {
|
|
6
|
+
|
|
7
|
+
public static List<TaskTriggerConfig> Configs = new List<TaskTriggerConfig>()
|
|
8
|
+
{
|
|
9
|
+
new TaskTriggerConfig(1, 50000, false, "", 0, "", 0, "", 0, "任务时限", 1001),
|
|
10
|
+
new TaskTriggerConfig(2, 50010, true, "前置任务", 50000, "", 0, "", 0, "任务时限", 1001),
|
|
11
|
+
new TaskTriggerConfig(7, 50020, true, "前置任务", 50010, "", 0, "", 0, "任务时限", 1001),
|
|
12
|
+
new TaskTriggerConfig(8, 50030, true, "前置任务", 50020, "", 0, "", 0, "任务时限", 1001),
|
|
13
|
+
new TaskTriggerConfig(9, 50040, true, "前置任务", 50030, "", 0, "", 0, "任务时限", 1001),
|
|
14
|
+
new TaskTriggerConfig(10, 50050, true, "前置任务", 50040, "", 0, "", 0, "任务时限", 1001),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
public TaskTriggerConfig() { }
|
|
18
|
+
public TaskTriggerConfig(int id, double taskId, bool autoAccept, string cond1, double para1, string cond2, double para2, string cond3, double para3, string limit1, double limitPara1)
|
|
19
|
+
{
|
|
20
|
+
this.Id = id;
|
|
21
|
+
this.TaskId = taskId;
|
|
22
|
+
this.AutoAccept = autoAccept;
|
|
23
|
+
this.Cond1 = cond1;
|
|
24
|
+
this.Para1 = para1;
|
|
25
|
+
this.Cond2 = cond2;
|
|
26
|
+
this.Para2 = para2;
|
|
27
|
+
this.Cond3 = cond3;
|
|
28
|
+
this.Para3 = para3;
|
|
29
|
+
this.Limit1 = limit1;
|
|
30
|
+
this.LimitPara1 = limitPara1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public virtual TaskTriggerConfig MergeFrom(TaskTriggerConfig source)
|
|
34
|
+
{
|
|
35
|
+
this.Id = source.Id;
|
|
36
|
+
this.TaskId = source.TaskId;
|
|
37
|
+
this.AutoAccept = source.AutoAccept;
|
|
38
|
+
this.Cond1 = source.Cond1;
|
|
39
|
+
this.Para1 = source.Para1;
|
|
40
|
+
this.Cond2 = source.Cond2;
|
|
41
|
+
this.Para2 = source.Para2;
|
|
42
|
+
this.Cond3 = source.Cond3;
|
|
43
|
+
this.Para3 = source.Para3;
|
|
44
|
+
this.Limit1 = source.Limit1;
|
|
45
|
+
this.LimitPara1 = source.LimitPara1;
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public virtual TaskTriggerConfig Clone()
|
|
50
|
+
{
|
|
51
|
+
var config = new TaskTriggerConfig();
|
|
52
|
+
config.MergeFrom(this);
|
|
53
|
+
return config;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
/// id
|
|
59
|
+
/// </summary>
|
|
60
|
+
public int Id;
|
|
61
|
+
/// <summary>
|
|
62
|
+
/// 任务ID
|
|
63
|
+
/// </summary>
|
|
64
|
+
public double TaskId;
|
|
65
|
+
/// <summary>
|
|
66
|
+
/// 是否自动领取
|
|
67
|
+
/// </summary>
|
|
68
|
+
public bool AutoAccept;
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// 条件1
|
|
71
|
+
/// wilwin wilwin:
|
|
72
|
+
/// q3wrjhqihruq
|
|
73
|
+
/// ]qwklhqwlkqw
|
|
74
|
+
/// qweklq
|
|
75
|
+
/// </summary>
|
|
76
|
+
public string Cond1;
|
|
77
|
+
/// <summary>
|
|
78
|
+
/// 条件1参数
|
|
79
|
+
/// </summary>
|
|
80
|
+
public double Para1;
|
|
81
|
+
/// <summary>
|
|
82
|
+
/// 条件2
|
|
83
|
+
/// </summary>
|
|
84
|
+
public string Cond2;
|
|
85
|
+
/// <summary>
|
|
86
|
+
/// 条件2参数
|
|
87
|
+
/// </summary>
|
|
88
|
+
public double Para2;
|
|
89
|
+
/// <summary>
|
|
90
|
+
/// 条件3
|
|
91
|
+
/// </summary>
|
|
92
|
+
public string Cond3;
|
|
93
|
+
/// <summary>
|
|
94
|
+
/// 条件3参数
|
|
95
|
+
/// </summary>
|
|
96
|
+
public double Para3;
|
|
97
|
+
/// <summary>
|
|
98
|
+
/// 约束1
|
|
99
|
+
/// </summary>
|
|
100
|
+
public string Limit1;
|
|
101
|
+
/// <summary>
|
|
102
|
+
/// 约束1参数
|
|
103
|
+
/// </summary>
|
|
104
|
+
public double LimitPara1;
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
#region get字段
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
#endregion
|
|
120
|
+
|
|
121
|
+
#region 生成fk.get/set
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
#endregion 生成fk.get/set
|
|
145
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
4
|
+
|
|
5
|
+
public class TimeLimit {
|
|
6
|
+
|
|
7
|
+
public static List<TimeLimit> Configs = new List<TimeLimit>()
|
|
8
|
+
{
|
|
9
|
+
new TimeLimit(1001, 24),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
public TimeLimit() { }
|
|
13
|
+
public TimeLimit(int id, double duration)
|
|
14
|
+
{
|
|
15
|
+
this.Id = id;
|
|
16
|
+
this.Duration = duration;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public virtual TimeLimit MergeFrom(TimeLimit source)
|
|
20
|
+
{
|
|
21
|
+
this.Id = source.Id;
|
|
22
|
+
this.Duration = source.Duration;
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public virtual TimeLimit Clone()
|
|
27
|
+
{
|
|
28
|
+
var config = new TimeLimit();
|
|
29
|
+
config.MergeFrom(this);
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
/// id
|
|
36
|
+
/// </summary>
|
|
37
|
+
public int Id;
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// 最大时限
|
|
40
|
+
/// </summary>
|
|
41
|
+
public double Duration;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
#region get字段
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
#endregion
|
|
48
|
+
|
|
49
|
+
#region 生成fk.get/set
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
#endregion 生成fk.get/set
|
|
55
|
+
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
3
4
|
|
|
4
|
-
public class
|
|
5
|
+
public class Sheet2 {
|
|
5
6
|
|
|
6
|
-
public static List<
|
|
7
|
+
public static List<Sheet2> Configs = new List<Sheet2>()
|
|
7
8
|
{
|
|
8
|
-
new
|
|
9
|
-
new
|
|
9
|
+
new Sheet2(1, "第1章 格莫拉城", 1000),
|
|
10
|
+
new Sheet2(2, "第2章 纳皮尔乐园", 1200),
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
public
|
|
13
|
-
public
|
|
13
|
+
public Sheet2() { }
|
|
14
|
+
public Sheet2(int uid, string sceneId, double outingBaseGold)
|
|
14
15
|
{
|
|
15
16
|
this.Uid = uid;
|
|
16
17
|
this.SceneId = sceneId;
|
|
17
18
|
this.OutingBaseGold = outingBaseGold;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
public virtual
|
|
21
|
+
public virtual Sheet2 MergeFrom(Sheet2 source)
|
|
21
22
|
{
|
|
22
23
|
this.Uid = source.Uid;
|
|
23
24
|
this.SceneId = source.SceneId;
|
|
@@ -25,31 +26,40 @@ public class SceneConfig {
|
|
|
25
26
|
return this;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
public virtual
|
|
29
|
+
public virtual Sheet2 Clone()
|
|
29
30
|
{
|
|
30
|
-
var config = new
|
|
31
|
+
var config = new Sheet2();
|
|
31
32
|
config.MergeFrom(this);
|
|
32
33
|
return config;
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
|
|
35
37
|
/// <summary>
|
|
36
38
|
/// uid
|
|
37
39
|
/// </summary>
|
|
38
40
|
public int Uid;
|
|
39
|
-
|
|
40
41
|
/// <summary>
|
|
41
42
|
/// 场景名
|
|
42
43
|
/// </summary>
|
|
43
44
|
public string SceneId;
|
|
44
|
-
|
|
45
45
|
/// <summary>
|
|
46
46
|
/// 出行基础金币收益
|
|
47
47
|
/// </summary>
|
|
48
48
|
public double OutingBaseGold;
|
|
49
49
|
|
|
50
|
+
|
|
50
51
|
#region get字段
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
54
55
|
#endregion
|
|
56
|
+
|
|
57
|
+
#region 生成fk.get/set
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
#endregion 生成fk.get/set
|
|
55
65
|
}
|
package/test/dist/SceneConfig.cs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
using System.Collections.Generic;
|
|
3
|
+
using System.Linq;
|
|
3
4
|
|
|
4
5
|
public class SceneConfig {
|
|
5
6
|
|
|
@@ -32,24 +33,33 @@ public class SceneConfig {
|
|
|
32
33
|
return config;
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
|
|
35
37
|
/// <summary>
|
|
36
38
|
/// uid
|
|
37
39
|
/// </summary>
|
|
38
40
|
public int Uid;
|
|
39
|
-
|
|
40
41
|
/// <summary>
|
|
41
42
|
/// 场景名
|
|
42
43
|
/// </summary>
|
|
43
44
|
public string SceneId;
|
|
44
|
-
|
|
45
45
|
/// <summary>
|
|
46
46
|
/// 出行基础金币收益
|
|
47
47
|
/// </summary>
|
|
48
48
|
public double OutingBaseGold;
|
|
49
49
|
|
|
50
|
+
|
|
50
51
|
#region get字段
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
54
55
|
#endregion
|
|
56
|
+
|
|
57
|
+
#region 生成fk.get/set
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
#endregion 生成fk.get/set
|
|
55
65
|
}
|
package/test/test.bat
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
node E:\DATA\Projects\netease\quicktable\export-table\dist\launch.js export src dist --tags csharp:cs --libs E:\DATA\Projects\netease\quicktable %*
|
|
File without changes
|
package/test/dist/Sheet2.csharp
DELETED
|
File without changes
|
package/test/dist/table.csharp
DELETED
|
File without changes
|