export-table-pulgin-csharp 1.0.42 → 1.0.43

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.
Files changed (48) hide show
  1. package/dist/ExportCSPlugin.js +21 -4
  2. package/dist/launch.d.ts +1 -0
  3. package/dist/launch.js +5 -0
  4. package/dist/launch.js.map +1 -0
  5. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-unit.cs +94 -0
  6. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-unit/350/241/250.cs +276 -0
  7. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/270/223/345/256/266/350/257/204/344/273/267.cs +210 -0
  8. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/270/273/351/242/230/344/277/241/346/201/257/350/241/250.cs +285 -0
  9. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/270/273/351/242/230/345/257/271/345/272/224unit.cs +93 -0
  10. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/273/273/345/212/241/345/260/217/347/273/223.cs +141 -0
  11. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/273/273/345/212/241/350/241/250.cs +151 -0
  12. package/dist//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250-/344/273/273/345/212/241/350/247/246/345/217/221/350/241/250.cs +111 -0
  13. package/package.json +25 -25
  14. package/quicktable//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250.xlsx +0 -0
  15. package/src/ExportCSPlugin.ts +20 -4
  16. package/src//350/257/276/347/250/213/344/277/241/346/201/257/350/241/250.xlsx +0 -0
  17. package/test/dist/SceneConfig.cs +55 -112
  18. package/test/dist/SceneConfig.csharp +0 -0
  19. package/test/dist/SceneConfig.csx +55 -0
  20. package/test/dist/Sheet2.csharp +0 -0
  21. package/test/dist/table.csharp +0 -0
  22. package/test/{testCS.bat → test.bat} +0 -0
  23. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/210/227/350/241/250.asset +0 -15
  24. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/210/227/350/241/250.cs +0 -226
  25. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/210/227/350/241/250Loader.cs +0 -26
  26. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/245/226/345/212/261.asset +0 -15
  27. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/245/226/345/212/261.cs +0 -115
  28. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/345/245/226/345/212/261Loader.cs +0 -26
  29. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/346/227/266/351/231/220.asset +0 -15
  30. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/346/227/266/351/231/220.cs +0 -88
  31. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/346/227/266/351/231/220Loader.cs +0 -26
  32. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/350/247/246/345/217/221/347/272/246/346/235/237/351/205/215/350/241/250.asset +0 -15
  33. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/350/247/246/345/217/221/347/272/246/346/235/237/351/205/215/350/241/250.cs +0 -291
  34. package/test/dist/EGBL/344/273/273/345/212/241/351/205/215/347/275/256-/344/273/273/345/212/241/350/247/246/345/217/221/347/272/246/346/235/237/351/205/215/350/241/250Loader.cs +0 -26
  35. package/test/dist/SceneConfig-SceneConfig.asset +0 -15
  36. package/test/dist/SceneConfig-SceneConfigLoader.cs +0 -26
  37. package/test/dist/SceneConfig-Sheet2.asset +0 -15
  38. package/test/dist/SceneConfig-Sheet2Loader.cs +0 -26
  39. package/test/dist//345/257/271/350/257/235/350/241/250-/345/257/271/350/257/235/350/241/250.asset +0 -15
  40. package/test/dist//345/257/271/350/257/235/350/241/250-/345/257/271/350/257/235/350/241/250.cs +0 -453
  41. package/test/dist//345/257/271/350/257/235/350/241/250-/345/257/271/350/257/235/350/241/250Loader.cs +0 -26
  42. package/test/dist//350/277/207/345/234/272/345/274/225/345/257/274-/350/277/207/345/234/272/345/274/225/345/257/274.asset +0 -15
  43. package/test/dist//350/277/207/345/234/272/345/274/225/345/257/274-/350/277/207/345/234/272/345/274/225/345/257/274.cs +0 -364
  44. package/test/dist//350/277/207/345/234/272/345/274/225/345/257/274-/350/277/207/345/234/272/345/274/225/345/257/274Loader.cs +0 -26
  45. package/test/src/EGBL/344/273/273/345/212/241/351/205/215/347/275/256.xlsx +0 -0
  46. package/test/src//345/257/271/350/257/235/350/241/250.xlsx +0 -0
  47. package/test/src//350/277/207/345/234/272/345/274/225/345/257/274.xlsx +0 -0
  48. package/test/testUJson.bat +0 -1
@@ -0,0 +1,111 @@
1
+
2
+ using System.Collections.Generic;
3
+ using System.Linq;
4
+
5
+ namespace MEEC.ExportedConfigs{
6
+ public partial class 任务触发表 {
7
+
8
+ public static List<任务触发表> Configs = new List<任务触发表>()
9
+ {
10
+ new 任务触发表(1, 1, "node_1"),
11
+ };
12
+
13
+ public 任务触发表() { }
14
+ public 任务触发表(int trigger_id, double trigger_type, string node_name)
15
+ {
16
+ this.TriggerId = trigger_id;
17
+ this.TriggerType = trigger_type;
18
+ this.NodeName = node_name;
19
+ }
20
+
21
+ public virtual 任务触发表 MergeFrom(任务触发表 source)
22
+ {
23
+ this.TriggerId = source.TriggerId;
24
+ this.TriggerType = source.TriggerType;
25
+ this.NodeName = source.NodeName;
26
+ return this;
27
+ }
28
+
29
+ public virtual 任务触发表 Clone()
30
+ {
31
+ var config = new 任务触发表();
32
+ config.MergeFrom(this);
33
+ return config;
34
+ }
35
+
36
+
37
+ /// <summary>
38
+ /// 触发id
39
+ /// </summary>
40
+ public int TriggerId;
41
+ /// <summary>
42
+ /// 触发类型
43
+ /// </summary>
44
+ public double TriggerType;
45
+ /// <summary>
46
+ /// 位置信息
47
+ /// </summary>
48
+ public string NodeName;
49
+
50
+
51
+ #region get字段
52
+
53
+
54
+
55
+ #endregion
56
+
57
+ #region uid map
58
+ protected static Dictionary<int, 任务触发表> _tempDictByTriggerId;
59
+ public static 任务触发表 GetConfigByTriggerId(int TriggerId)
60
+ {
61
+ if (_tempDictByTriggerId == null)
62
+ {
63
+ _tempDictByTriggerId = new Dictionary<int, 任务触发表>();
64
+ Configs.ForEach(c =>
65
+ {
66
+ _tempDictByTriggerId.Add(c.TriggerId, c);
67
+ });
68
+ }
69
+ return _tempDictByTriggerId.GetValueOrDefault(TriggerId);
70
+ }
71
+ protected static Dictionary<double, 任务触发表[]> _tempRecordsDictByTriggerType = new Dictionary<double, 任务触发表[]>();
72
+ public static 任务触发表[] GetConfigsByTriggerType(double TriggerType)
73
+ {
74
+ if (_tempRecordsDictByTriggerType.ContainsKey(TriggerType))
75
+ {
76
+ return _tempRecordsDictByTriggerType.GetValueOrDefault(TriggerType);
77
+ }
78
+ else
79
+ {
80
+ var records = Configs.Where(c => c.TriggerType == TriggerType).ToArray();
81
+ _tempRecordsDictByTriggerType.Add(TriggerType, records);
82
+ return records;
83
+ }
84
+ }
85
+ protected static Dictionary<string, 任务触发表[]> _tempRecordsDictByNodeName = new Dictionary<string, 任务触发表[]>();
86
+ public static 任务触发表[] GetConfigsByNodeName(string NodeName)
87
+ {
88
+ if (_tempRecordsDictByNodeName.ContainsKey(NodeName))
89
+ {
90
+ return _tempRecordsDictByNodeName.GetValueOrDefault(NodeName);
91
+ }
92
+ else
93
+ {
94
+ var records = Configs.Where(c => c.NodeName == NodeName).ToArray();
95
+ _tempRecordsDictByNodeName.Add(NodeName, records);
96
+ return records;
97
+ }
98
+ }
99
+
100
+ #endregion uid map
101
+
102
+ #region 生成fk.get/set
103
+
104
+
105
+
106
+
107
+
108
+
109
+ #endregion 生成fk.get/set
110
+ }
111
+ }
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "name": "export-table-pulgin-csharp",
3
- "version": "1.0.42",
4
- "description": "",
5
- "main": "./dist/index.js",
6
- "scripts": {
7
- "pub": "npm-publish --token=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"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/windyuuy/export-table-pulgin-csharp.git"
12
- },
13
- "author": "windyuuy",
14
- "license": "ISC",
15
- "dependencies": {
16
- "@types/node": "^17.0.18",
17
- "export-table-lib": "latest",
18
- "fs": "^0.0.1-security",
19
- "fs-extra": "^10.0.0",
20
- "fse": "^4.0.1"
21
- },
22
- "devDependencies": {
23
- "@types/fs-extra": "^9.0.13"
24
- }
25
- }
1
+ {
2
+ "name": "export-table-pulgin-csharp",
3
+ "version": "1.0.43",
4
+ "description": "",
5
+ "main": "./dist/index.js",
6
+ "scripts": {
7
+ "pub": "npm-publish --token=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"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/windyuuy/export-table-pulgin-csharp.git"
12
+ },
13
+ "author": "windyuuy",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "@types/node": "^17.0.18",
17
+ "export-table-lib": "latest",
18
+ "fs": "^0.0.1-security",
19
+ "fs-extra": "^10.0.0",
20
+ "fse": "^4.0.1"
21
+ },
22
+ "devDependencies": {
23
+ "@types/fs-extra": "^9.0.13"
24
+ }
25
+ }
@@ -1,6 +1,7 @@
1
1
 
2
2
  import { cmm, HandleSheetParams, Field, foreach, IPlugin, st, PluginBase, HandleBatchParams, iff } from "export-table-lib"
3
3
  import * as fs from "fs-extra"
4
+ import { json } from "stream/consumers";
4
5
 
5
6
  export function export_stuff(paras: HandleSheetParams): string | null {
6
7
  let {
@@ -33,9 +34,11 @@ export function export_stuff(paras: HandleSheetParams): string | null {
33
34
  let getFieldType = function (f: Field) {
34
35
  let t = f.type
35
36
  if (t == "object") {
36
- throw new Error("invalid type <object>")
37
+ //throw new Error("invalid type <Dictionary<string,string>>")
38
+ return "Dictionary<string,string>"
37
39
  } else if (t == "object[]") {
38
- throw new Error("invalid type <object[]>")
40
+ //throw new Error("invalid type <Dictionary<string,string>[]>")
41
+ return "List<Dictionary<string,string>>"
39
42
  } else if (t == "number") {
40
43
  return "double";
41
44
  } else if (t == "number[]") {
@@ -72,9 +75,22 @@ export function export_stuff(paras: HandleSheetParams): string | null {
72
75
  const genValue = (value: any, f: Field): string => {
73
76
  let t = f.type
74
77
  if (t == "object") {
75
- throw new Error("invalid type <object>")
78
+ //throw new Error("invalid type <object>")
79
+ let convert:string[] = [];
80
+ for (let k in value) {
81
+ convert.push(`{"${k}","${(value as any)[k].toString()}"}`);
82
+ };
83
+ return `new Dictionary<string,string>(){${convert}}`;
76
84
  } else if (t == "object[]") {
77
- throw new Error("invalid type <object[]>")
85
+ let values = value as object[];
86
+ //throw new Error("invalid type <object[]>")
87
+ return `new List<Dictionary<string,string>>(){${values.map((val)=>{
88
+ let convert:string[] = [];
89
+ for (let k in val) {
90
+ convert.push(`{"${k}","${(val as any)[k].toString()}"}`);
91
+ };
92
+ return `new Dictionary<string,string>(){${convert}}`;
93
+ })}}`
78
94
  } else if (t == "number") {
79
95
  return `${value}`
80
96
  } else if (t == "number[]") {
@@ -1,112 +1,55 @@
1
-
2
- using System.Collections.Generic;
3
- using System.Linq;
4
-
5
- namespace MEEC.ExportedConfigs{
6
- public partial class SceneConfig {
7
-
8
- public static List<SceneConfig> Configs = new List<SceneConfig>()
9
- {
10
- new SceneConfig(1, "第1章 格莫拉城", 1000),
11
- new SceneConfig(2, "第2章 纳皮尔乐园", 1200),
12
- };
13
-
14
- public SceneConfig() { }
15
- public SceneConfig(int uid, string sceneId, double outingBaseGold)
16
- {
17
- this.Uid = uid;
18
- this.SceneId = sceneId;
19
- this.OutingBaseGold = outingBaseGold;
20
- }
21
-
22
- public virtual SceneConfig MergeFrom(SceneConfig source)
23
- {
24
- this.Uid = source.Uid;
25
- this.SceneId = source.SceneId;
26
- this.OutingBaseGold = source.OutingBaseGold;
27
- return this;
28
- }
29
-
30
- public virtual SceneConfig Clone()
31
- {
32
- var config = new SceneConfig();
33
- config.MergeFrom(this);
34
- return config;
35
- }
36
-
37
-
38
- /// <summary>
39
- /// uid
40
- /// </summary>
41
- public int Uid;
42
- /// <summary>
43
- /// 场景名
44
- /// </summary>
45
- public string SceneId;
46
- /// <summary>
47
- /// 出行基础金币收益
48
- /// </summary>
49
- public double OutingBaseGold;
50
-
51
-
52
- #region get字段
53
-
54
-
55
-
56
- #endregion
57
-
58
- #region uid map
59
- protected static Dictionary<int, SceneConfig> _tempDictByUid;
60
- public static SceneConfig GetConfigByUid(int Uid)
61
- {
62
- if (_tempDictByUid == null)
63
- {
64
- _tempDictByUid = new Dictionary<int, SceneConfig>();
65
- Configs.ForEach(c =>
66
- {
67
- _tempDictByUid.Add(c.Uid, c);
68
- });
69
- }
70
- return _tempDictByUid.GetValueOrDefault(Uid);
71
- }
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
- }
100
-
101
- #endregion uid map
102
-
103
- #region 生成fk.get/set
104
-
105
-
106
-
107
-
108
-
109
-
110
- #endregion 生成fk.get/set
111
- }
112
- }
1
+
2
+ using System.Collections.Generic;
3
+
4
+ public class SceneConfig {
5
+
6
+ public static List<SceneConfig> Configs = new List<SceneConfig>()
7
+ {
8
+ new SceneConfig(1, "第1章 格莫拉城", 1000),
9
+ new SceneConfig(2, "第2章 纳皮尔乐园", 1200),
10
+ };
11
+
12
+ public SceneConfig() { }
13
+ public SceneConfig(int uid, string sceneId, double outingBaseGold)
14
+ {
15
+ this.Uid = uid;
16
+ this.SceneId = sceneId;
17
+ this.OutingBaseGold = outingBaseGold;
18
+ }
19
+
20
+ public virtual SceneConfig MergeFrom(SceneConfig source)
21
+ {
22
+ this.Uid = source.Uid;
23
+ this.SceneId = source.SceneId;
24
+ this.OutingBaseGold = source.OutingBaseGold;
25
+ return this;
26
+ }
27
+
28
+ public virtual SceneConfig Clone()
29
+ {
30
+ var config = new SceneConfig();
31
+ config.MergeFrom(this);
32
+ return config;
33
+ }
34
+
35
+ /// <summary>
36
+ /// uid
37
+ /// </summary>
38
+ public int Uid;
39
+
40
+ /// <summary>
41
+ /// 场景名
42
+ /// </summary>
43
+ public string SceneId;
44
+
45
+ /// <summary>
46
+ /// 出行基础金币收益
47
+ /// </summary>
48
+ public double OutingBaseGold;
49
+
50
+ #region get字段
51
+ public int uid => Uid;
52
+ public string 场景名 => SceneId;
53
+ public double 出行基础金币收益 => OutingBaseGold;
54
+ #endregion
55
+ }
File without changes
@@ -0,0 +1,55 @@
1
+
2
+ using System.Collections.Generic;
3
+
4
+ public class SceneConfig {
5
+
6
+ public static List<SceneConfig> Configs = new List<SceneConfig>()
7
+ {
8
+ new SceneConfig(1, "第1章 格莫拉城", 1000),
9
+ new SceneConfig(2, "第2章 纳皮尔乐园", 1200),
10
+ };
11
+
12
+ public SceneConfig() { }
13
+ public SceneConfig(int uid, string sceneId, double outingBaseGold)
14
+ {
15
+ this.Uid = uid;
16
+ this.SceneId = sceneId;
17
+ this.OutingBaseGold = outingBaseGold;
18
+ }
19
+
20
+ public virtual SceneConfig MergeFrom(SceneConfig source)
21
+ {
22
+ this.Uid = source.Uid;
23
+ this.SceneId = source.SceneId;
24
+ this.OutingBaseGold = source.OutingBaseGold;
25
+ return this;
26
+ }
27
+
28
+ public virtual SceneConfig Clone()
29
+ {
30
+ var config = new SceneConfig();
31
+ config.MergeFrom(this);
32
+ return config;
33
+ }
34
+
35
+ /// <summary>
36
+ /// uid
37
+ /// </summary>
38
+ public int Uid;
39
+
40
+ /// <summary>
41
+ /// 场景名
42
+ /// </summary>
43
+ public string SceneId;
44
+
45
+ /// <summary>
46
+ /// 出行基础金币收益
47
+ /// </summary>
48
+ public double OutingBaseGold;
49
+
50
+ #region get字段
51
+ public int uid => Uid;
52
+ public string 场景名 => SceneId;
53
+ public double 出行基础金币收益 => OutingBaseGold;
54
+ #endregion
55
+ }
File without changes
File without changes
File without changes
@@ -1,15 +0,0 @@
1
- %YAML 1.1
2
- %TAG !u! tag:unity3d.com,2011:
3
- --- !u!114 &11400000
4
- MonoBehaviour:
5
- m_ObjectHideFlags: 0
6
- m_CorrespondingSourceObject: {fileID: 0}
7
- m_PrefabInstance: {fileID: 0}
8
- m_PrefabAsset: {fileID: 0}
9
- m_GameObject: {fileID: 0}
10
- m_Enabled: 1
11
- m_EditorHideFlags: 0
12
- m_Script: {fileID: 11500000, guid: 496f60086c072a8479a6e0b948efb5e8, type: 3}
13
- m_Name: EGBL任务配置-任务列表
14
- m_EditorClassIdentifier:
15
- JsonText: "[{\"Id\":50000,\"Name\":\"口腔\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"`/tp @e[type=npc,c=1,tag=消化NPC] 24 47 -171`\",\"SucceedCmds\":\"\"},{\"Id\":50010,\"Name\":\"食道和胃\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"\",\"SucceedCmds\":\"`/title @p title 恭喜你完成口腔关卡`,`/give @p myitem:xhdlxj_modle_kouqiang`\"},{\"Id\":50020,\"Name\":\"小肠\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"\",\"SucceedCmds\":\"`/title @p title 恭喜你完成食道&胃关卡`,`/give @p myitem:xhdlxj_modle_shiguan`,`/give @p myitem:xhdlxj_modle_wei`\"},{\"Id\":50030,\"Name\":\"大肠\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"\",\"SucceedCmds\":\"`/title @p title 恭喜你完成小肠关卡`\"},{\"Id\":50040,\"Name\":\"消化拼图\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"\",\"SucceedCmds\":\"`/title @p title 恭喜你完成大肠关卡`,`/give @p myitem:xhdlxj_modle_xiaochang`,`/give @p myitem:xhdlxj_modle_dachang`\"},{\"Id\":50050,\"Name\":\"恭喜完成\",\"SubTasks\":[],\"TaskRewards\":[],\"任务类型\":\"\",\"任务标签\":\"\",\"StartCmds\":\"\",\"SucceedCmds\":\"`/title @p title 恭喜你完成课程内容`\"}]"
@@ -1,226 +0,0 @@
1
-
2
- using System.Collections.Generic;
3
- using System.Linq;
4
-
5
- namespace MEEC.ExportedConfigs{
6
- public partial class 任务列表 {
7
-
8
- public static List<任务列表> Configs = new List<任务列表>()
9
- {
10
- new 任务列表(50000, "口腔", new double[]{}, new int[]{}, "", "", "`/tp @e[type=npc,c=1,tag=消化NPC] 24 47 -171`", ""),
11
- new 任务列表(50010, "食道和胃", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成口腔关卡`,`/give @p myitem:xhdlxj_modle_kouqiang`"),
12
- new 任务列表(50020, "小肠", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成食道&胃关卡`,`/give @p myitem:xhdlxj_modle_shiguan`,`/give @p myitem:xhdlxj_modle_wei`"),
13
- new 任务列表(50030, "大肠", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成小肠关卡`"),
14
- new 任务列表(50040, "消化拼图", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成大肠关卡`,`/give @p myitem:xhdlxj_modle_xiaochang`,`/give @p myitem:xhdlxj_modle_dachang`"),
15
- new 任务列表(50050, "恭喜完成", new double[]{}, new int[]{}, "", "", "", "`/title @p title 恭喜你完成课程内容`"),
16
- };
17
-
18
- public 任务列表() { }
19
- public 任务列表(int id, string name, double[] subTasks, int[] taskRewards, string 任务类型, string 任务标签, string startCmds, string succeedCmds)
20
- {
21
- this.Id = id;
22
- this.Name = name;
23
- this.SubTasks = subTasks;
24
- this.TaskRewards = taskRewards;
25
- this.任务类型 = 任务类型;
26
- this.任务标签 = 任务标签;
27
- this.StartCmds = startCmds;
28
- this.SucceedCmds = succeedCmds;
29
- }
30
-
31
- public virtual 任务列表 MergeFrom(任务列表 source)
32
- {
33
- this.Id = source.Id;
34
- this.Name = source.Name;
35
- this.SubTasks = source.SubTasks;
36
- this.TaskRewards = source.TaskRewards;
37
- this.任务类型 = source.任务类型;
38
- this.任务标签 = source.任务标签;
39
- this.StartCmds = source.StartCmds;
40
- this.SucceedCmds = source.SucceedCmds;
41
- return this;
42
- }
43
-
44
- public virtual 任务列表 Clone()
45
- {
46
- var config = new 任务列表();
47
- config.MergeFrom(this);
48
- return config;
49
- }
50
-
51
-
52
- /// <summary>
53
- /// 任务ID
54
- /// </summary>
55
- public int Id;
56
- /// <summary>
57
- /// 任务名称
58
- /// </summary>
59
- public string Name;
60
- /// <summary>
61
- /// 子任务
62
- /// </summary>
63
- public double[] SubTasks;
64
- /// <summary>
65
- /// 奖励物品
66
- /// wilwin wilwin:
67
- /// 可配置多个,符号 ";" 号分割
68
- /// 1001;1002;1003
69
- /// </summary>
70
- public int[] TaskRewards;
71
- /// <summary>
72
- /// 任务类型(客户端展示分类)
73
- /// </summary>
74
- public string 任务类型;
75
- /// <summary>
76
- /// 任务标签(客户端展示)
77
- /// </summary>
78
- public string 任务标签;
79
- /// <summary>
80
- /// 任务开始执行命令
81
- /// </summary>
82
- public string StartCmds;
83
- /// <summary>
84
- /// 任务成功执行命令
85
- /// </summary>
86
- public string SucceedCmds;
87
-
88
-
89
- #region get字段
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- #endregion
99
-
100
- #region uid map
101
- protected static Dictionary<int, 任务列表> _tempDictById;
102
- public static 任务列表 GetConfigById(int Id)
103
- {
104
- if (_tempDictById == null)
105
- {
106
- _tempDictById = new Dictionary<int, 任务列表>();
107
- Configs.ForEach(c =>
108
- {
109
- _tempDictById.Add(c.Id, c);
110
- });
111
- }
112
- return _tempDictById.GetValueOrDefault(Id);
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
- }
128
-
129
-
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
- }
186
-
187
- #endregion uid map
188
-
189
- #region 生成fk.get/set
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
- protected 任务奖励[] _fkTaskRewards=null;
198
- /**
199
- * 奖励物品
200
- wilwin wilwin:
201
- 可配置多个,符号 ";" 号分割
202
- 1001;1002;1003
203
- **/
204
- public virtual 任务奖励[] TaskRewardsDataList{
205
- get{
206
- if(this._fkTaskRewards==null){
207
- if(null==this.TaskRewards){
208
- this._fkTaskRewards = new 任务奖励[0];
209
- }else{
210
- this._fkTaskRewards=MEEC.ExportedConfigs.任务奖励.Configs.FindAll(a=>a.Id!=null && this.TaskRewards!.Contains(a.Id)).ToArray();
211
- }
212
- }
213
- return this._fkTaskRewards;
214
- }
215
- }
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
- #endregion 生成fk.get/set
225
- }
226
- }