@ives_xxz/framework 2.1.38 → 2.1.40
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/Framework.ts +7 -5
- package/FrameworkBase.ts +6 -6
- package/package.json +1 -1
package/Framework.ts
CHANGED
|
@@ -26,7 +26,7 @@ export class Framework implements FW.Framework {
|
|
|
26
26
|
return this.container.get<T>(serviceIdentifier);
|
|
27
27
|
}
|
|
28
28
|
} else if (typeof serviceIdentifier === "function") {
|
|
29
|
-
const className = serviceIdentifier
|
|
29
|
+
const className = serviceIdentifier?.name;
|
|
30
30
|
|
|
31
31
|
if (this.container.isBound(serviceIdentifier)) {
|
|
32
32
|
return this.container.get<T>(serviceIdentifier);
|
|
@@ -48,12 +48,10 @@ export class Framework implements FW.Framework {
|
|
|
48
48
|
const bundleName = FW.Entry.bundleName;
|
|
49
49
|
const tag = suffixMap[suffix as keyof typeof suffixMap];
|
|
50
50
|
const bindingKey = this.getKey(bundleName, tag);
|
|
51
|
-
|
|
52
51
|
if (this.container.isBound(bindingKey)) {
|
|
53
52
|
return this.container.get<T>(bindingKey);
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
|
|
57
55
|
return this.getComponents(serviceIdentifier)[0];
|
|
58
56
|
}
|
|
59
57
|
}
|
|
@@ -216,7 +214,9 @@ export class Framework implements FW.Framework {
|
|
|
216
214
|
(reg) =>
|
|
217
215
|
reg.logic === data.logic &&
|
|
218
216
|
reg.data === data.data &&
|
|
219
|
-
reg.config === data.config
|
|
217
|
+
reg.config === data.config &&
|
|
218
|
+
reg.sender === data.sender &&
|
|
219
|
+
reg.handle === data.handle,
|
|
220
220
|
);
|
|
221
221
|
|
|
222
222
|
if (!exists) {
|
|
@@ -232,7 +232,9 @@ export class Framework implements FW.Framework {
|
|
|
232
232
|
(reg) =>
|
|
233
233
|
reg.logic === data.logic &&
|
|
234
234
|
reg.data === data.data &&
|
|
235
|
-
reg.config === data.config
|
|
235
|
+
reg.config === data.config &&
|
|
236
|
+
reg.sender === data.sender &&
|
|
237
|
+
reg.handle === data.handle,
|
|
236
238
|
);
|
|
237
239
|
|
|
238
240
|
if (index !== -1) {
|
package/FrameworkBase.ts
CHANGED
|
@@ -34,7 +34,7 @@ export abstract class FrameworkBase {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
protected get moduleName(): string {
|
|
37
|
-
return
|
|
37
|
+
return cc.js.getClassName(this);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
public getLogic<T extends FW.Logic = FW.Logic>() {
|
|
@@ -69,31 +69,31 @@ export abstract class FrameworkBase {
|
|
|
69
69
|
const tag = this.getClassTag();
|
|
70
70
|
|
|
71
71
|
if (tag !== FW.SystemDefine.FWBindTag.LOGIC) {
|
|
72
|
-
this.logic = FW.
|
|
72
|
+
this.logic = FW.Entry.getComponent<FW.Logic>(
|
|
73
73
|
`${bundleName}${FW.SystemDefine.FWBindTag.LOGIC}`,
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
if (tag !== FW.SystemDefine.FWBindTag.DATA) {
|
|
78
|
-
this.data = FW.
|
|
78
|
+
this.data = FW.Entry.getComponent<FW.Data>(
|
|
79
79
|
`${bundleName}${FW.SystemDefine.FWBindTag.DATA}`,
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (tag !== FW.SystemDefine.FWBindTag.CONFIG) {
|
|
84
|
-
this.config = FW.
|
|
84
|
+
this.config = FW.Entry.getComponent<FW.AssetConfig>(
|
|
85
85
|
`${bundleName}${FW.SystemDefine.FWBindTag.CONFIG}`,
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (tag !== FW.SystemDefine.FWBindTag.SENDER) {
|
|
90
|
-
this.sender = FW.
|
|
90
|
+
this.sender = FW.Entry.getComponent<FW.Sender>(
|
|
91
91
|
`${bundleName}${FW.SystemDefine.FWBindTag.SENDER}`,
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if (tag !== FW.SystemDefine.FWBindTag.HANDLE) {
|
|
96
|
-
this.handle = FW.
|
|
96
|
+
this.handle = FW.Entry.getComponent<FW.Handle>(
|
|
97
97
|
`${bundleName}${FW.SystemDefine.FWBindTag.HANDLE}`,
|
|
98
98
|
);
|
|
99
99
|
}
|