@ives_xxz/framework 2.2.0 → 2.3.0
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 +2 -1
- package/FrameworkBase.ts +1 -8
- package/FrameworkInitialize.ts +71 -4
- package/define/FWTypes.ts +30 -0
- package/define/FWTypes.ts.meta +9 -0
- package/entry/FWEntry.ts +28 -108
- package/log/FWLog.ts +4 -8
- package/manager/FWAnimationManager.ts +2 -0
- package/manager/FWAssetManager.ts +6 -1
- package/manager/FWAudioManager.ts +2 -0
- package/manager/FWBundleManager.ts +6 -1
- package/manager/FWComponentManager.ts +2 -0
- package/manager/FWEngineManager.ts +2 -0
- package/manager/FWEventManager.ts +5 -1
- package/manager/FWHotUpdateManager.ts +2 -0
- package/manager/FWLanguageManager.ts +2 -0
- package/manager/FWLayerManager.ts +2 -0
- package/manager/FWObjectManager.ts +2 -0
- package/manager/FWPerformanceManager.ts +3 -1
- package/manager/FWPromiseManager.ts +2 -0
- package/manager/FWResManager.ts +11 -4
- package/manager/FWSocketManager.ts +2 -0
- package/manager/FWStateManager.ts +3 -1
- package/manager/FWTaskManager.ts +2 -0
- package/manager/FWTimeManager.ts +2 -0
- package/manager/FWUiManager.ts +2 -0
- package/package.json +1 -1
- package/utils/FWUtils.ts +3 -0
package/Framework.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { Container, interfaces } from "inversify";
|
|
2
|
+
import { Container, interfaces, injectable } from "inversify";
|
|
3
3
|
|
|
4
|
+
@injectable()
|
|
4
5
|
export class Framework implements FW.Framework {
|
|
5
6
|
private container: Container;
|
|
6
7
|
private registry: Map<string, new () => FW.Registry>;
|
package/FrameworkBase.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { injectable } from "inversify";
|
|
|
2
2
|
|
|
3
3
|
@injectable()
|
|
4
4
|
export abstract class FrameworkBase {
|
|
5
|
-
public
|
|
5
|
+
public logic?: FW.Logic;
|
|
6
6
|
public data?: FW.Data;
|
|
7
7
|
public config?: FW.AssetConfig;
|
|
8
8
|
public sender?: FW.Sender;
|
|
@@ -16,13 +16,6 @@ export abstract class FrameworkBase {
|
|
|
16
16
|
return FW.Entry;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
get logic() {
|
|
20
|
-
return this._logic;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
set logic(value: FW.Logic) {
|
|
24
|
-
this._logic = value;
|
|
25
|
-
}
|
|
26
19
|
|
|
27
20
|
constructor() {
|
|
28
21
|
this.initialize?.();
|
package/FrameworkInitialize.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { FW_TYPES } from "./define/FWTypes";
|
|
2
|
+
import { Container } from "inversify";
|
|
3
|
+
|
|
1
4
|
export function initializeFramework() {
|
|
2
5
|
const WD = window as any;
|
|
3
6
|
const SD = require("./define/FWSystemDefine");
|
|
4
7
|
const ED = require("./define/FWEventDefine");
|
|
5
8
|
|
|
6
|
-
//
|
|
9
|
+
// 防止重复初始化导致状态错乱(例如热重载或多次调用)
|
|
7
10
|
if (WD.FW && WD.FW.Framework && WD.FW.Entry) {
|
|
8
11
|
return;
|
|
9
12
|
}
|
|
@@ -58,22 +61,86 @@ export function initializeFramework() {
|
|
|
58
61
|
FW.Service = require("./service/FWService").FWService;
|
|
59
62
|
FW.Http = require("./service/http/FWHttp").FWHttp;
|
|
60
63
|
FW.Registry = require("./registry/FWRegistry").FWRegistry;
|
|
61
|
-
FW.Framework = new (require("./Framework").Framework)();
|
|
62
64
|
FW.FrameworkBase = require("./FrameworkBase").FrameworkBase;
|
|
63
65
|
FW.Object = require("./utils/FWObject").FWObject;
|
|
64
|
-
FW.Entry = new (require("./entry/FWEntry").FWEntry)();
|
|
65
66
|
FW.Scene = require("./scene/FWScene").FWScene;
|
|
66
67
|
FW.Logic = require("./logic/FWLogic").FWLogic;
|
|
67
68
|
FW.Data = require("./data/FWData").FWData;
|
|
68
69
|
FW.Sender = require("./service/socket/FWSocketSender").FWSocketSender;
|
|
69
70
|
FW.Handle = require("./service/socket/FWSocketHandle").FWSocketHandle;
|
|
70
71
|
FW.AssetConfig = require("./config/FWAssetConfig").FWAssetConfig;
|
|
71
|
-
FW.Log = new (require("./log/FWLog").FWLog)();
|
|
72
72
|
FW.Layer = require("./layer/FWLayer").FWLayer;
|
|
73
73
|
FW.LayerController =
|
|
74
74
|
require("./controller/FWLayerController").FWLayerController;
|
|
75
75
|
FW.SocketMock =
|
|
76
76
|
new (require("./service/socket/mock/FWSocketMock").FWSocketMock)();
|
|
77
|
+
|
|
78
|
+
const container = initializeContainer();
|
|
79
|
+
|
|
80
|
+
FW.Framework = container.get<FW.Framework>(FW_TYPES.Framework);
|
|
81
|
+
FW.Entry = container.get<FW.Entry>(FW_TYPES.Entry);
|
|
82
|
+
FW.Log = container.get<FW.Log>(FW_TYPES.Log);
|
|
83
|
+
|
|
77
84
|
FW.Framework.initialize();
|
|
78
85
|
FW.Entry.initialize();
|
|
79
86
|
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
function initializeContainer(): Container {
|
|
90
|
+
const container = new Container({
|
|
91
|
+
defaultScope: "Singleton",
|
|
92
|
+
autoBindInjectable: true,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const { Framework } = require("./Framework");
|
|
96
|
+
const { FWEntry } = require("./entry/FWEntry");
|
|
97
|
+
const { FWLog } = require("./log/FWLog");
|
|
98
|
+
|
|
99
|
+
container.bind<FW.Framework>(FW_TYPES.Framework).to(Framework).inSingletonScope();
|
|
100
|
+
container.bind<FW.Entry>(FW_TYPES.Entry).to(FWEntry).inSingletonScope();
|
|
101
|
+
container.bind<FW.Log>(FW_TYPES.Log).to(FWLog).inSingletonScope();
|
|
102
|
+
|
|
103
|
+
const FWTimeManager = require("./manager/FWTimeManager").default;
|
|
104
|
+
const { FWLayerManager } = require("./manager/FWLayerManager");
|
|
105
|
+
const { FWResManager } = require("./manager/FWResManager");
|
|
106
|
+
const { FWAssetManager } = require("./manager/FWAssetManager");
|
|
107
|
+
const FWBundleManager = require("./manager/FWBundleManager").default;
|
|
108
|
+
const FWEventManager = require("./manager/FWEventManager").default;
|
|
109
|
+
const FWAudioManager = require("./manager/FWAudioManager").default;
|
|
110
|
+
const FWSocketManager = require("./manager/FWSocketManager").default;
|
|
111
|
+
const FWAnimationManager = require("./manager/FWAnimationManager").default;
|
|
112
|
+
const { FWStateManager } = require("./manager/FWStateManager");
|
|
113
|
+
const FWObjectManager = require("./manager/FWObjectManager").default;
|
|
114
|
+
const FWUiManager = require("./manager/FWUiManager").default;
|
|
115
|
+
const FWTaskManager = require("./manager/FWTaskManager").default;
|
|
116
|
+
const FWComponentManager = require("./manager/FWComponentManager").default;
|
|
117
|
+
const FWLanguageManager = require("./manager/FWLanguageManager").default;
|
|
118
|
+
const FWEngineManager = require("./manager/FWEngineManager").default;
|
|
119
|
+
const FWHotUpdateManager = require("./manager/FWHotUpdateManager").default;
|
|
120
|
+
const FWPromiseManager = require("./manager/FWPromiseManager").default;
|
|
121
|
+
const { FWPerformanceManager } = require("./manager/FWPerformanceManager");
|
|
122
|
+
const FWUtils = require("./utils/FWUtils").default;
|
|
123
|
+
|
|
124
|
+
container.bind<FW.TimeManager>(FW_TYPES.TimeManager).to(FWTimeManager).inSingletonScope();
|
|
125
|
+
container.bind<FW.LayerManager>(FW_TYPES.LayerManager).to(FWLayerManager).inSingletonScope();
|
|
126
|
+
container.bind<FW.ResManager>(FW_TYPES.ResManager).to(FWResManager).inSingletonScope();
|
|
127
|
+
container.bind<FW.AssetManager>(FW_TYPES.AssetManager).to(FWAssetManager).inSingletonScope();
|
|
128
|
+
container.bind<FW.BundleManager>(FW_TYPES.BundleManager).to(FWBundleManager).inSingletonScope();
|
|
129
|
+
container.bind<FW.EventManager>(FW_TYPES.EventManager).to(FWEventManager).inSingletonScope();
|
|
130
|
+
container.bind<FW.AudioManager>(FW_TYPES.AudioManager).to(FWAudioManager).inSingletonScope();
|
|
131
|
+
container.bind<FW.SocketManager>(FW_TYPES.SocketManager).to(FWSocketManager).inSingletonScope();
|
|
132
|
+
container.bind<FW.AnimationManager>(FW_TYPES.AnimationManager).to(FWAnimationManager).inSingletonScope();
|
|
133
|
+
container.bind<FW.StateManager>(FW_TYPES.StateManager).to(FWStateManager).inSingletonScope();
|
|
134
|
+
container.bind<FW.ObjectManager>(FW_TYPES.ObjectManager).to(FWObjectManager).inSingletonScope();
|
|
135
|
+
container.bind<FW.UiManager>(FW_TYPES.UiManager).to(FWUiManager).inSingletonScope();
|
|
136
|
+
container.bind<FW.TaskManager>(FW_TYPES.TaskManager).to(FWTaskManager).inSingletonScope();
|
|
137
|
+
container.bind<FW.ComponentManager>(FW_TYPES.ComponentManager).to(FWComponentManager).inSingletonScope();
|
|
138
|
+
container.bind<FW.LanguageManager>(FW_TYPES.LanguageManager).to(FWLanguageManager).inSingletonScope();
|
|
139
|
+
container.bind<FW.EngineManager>(FW_TYPES.EngineManager).to(FWEngineManager).inSingletonScope();
|
|
140
|
+
container.bind<FW.HotUpdateManager>(FW_TYPES.HotUpdateManager).to(FWHotUpdateManager).inSingletonScope();
|
|
141
|
+
container.bind<FW.PromiseManager>(FW_TYPES.PromiseManager).to(FWPromiseManager).inSingletonScope();
|
|
142
|
+
container.bind<FW.PerformanceManager>(FW_TYPES.PerformanceManager).to(FWPerformanceManager).inSingletonScope();
|
|
143
|
+
container.bind<FW.Utils>(FW_TYPES.Utils).to(FWUtils).inSingletonScope();
|
|
144
|
+
|
|
145
|
+
return container;
|
|
146
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IoC 容器类型标识符
|
|
3
|
+
*/
|
|
4
|
+
export const FW_TYPES = {
|
|
5
|
+
Entry: Symbol.for("Entry"),
|
|
6
|
+
Framework: Symbol.for("Framework"),
|
|
7
|
+
|
|
8
|
+
TimeManager: Symbol.for("TimeManager"),
|
|
9
|
+
LayerManager: Symbol.for("LayerManager"),
|
|
10
|
+
ResManager: Symbol.for("ResManager"),
|
|
11
|
+
AssetManager: Symbol.for("AssetManager"),
|
|
12
|
+
BundleManager: Symbol.for("BundleManager"),
|
|
13
|
+
EventManager: Symbol.for("EventManager"),
|
|
14
|
+
AudioManager: Symbol.for("AudioManager"),
|
|
15
|
+
SocketManager: Symbol.for("SocketManager"),
|
|
16
|
+
AnimationManager: Symbol.for("AnimationManager"),
|
|
17
|
+
StateManager: Symbol.for("StateManager"),
|
|
18
|
+
ObjectManager: Symbol.for("ObjectManager"),
|
|
19
|
+
UiManager: Symbol.for("UiManager"),
|
|
20
|
+
TaskManager: Symbol.for("TaskManager"),
|
|
21
|
+
ComponentManager: Symbol.for("ComponentManager"),
|
|
22
|
+
LanguageManager: Symbol.for("LanguageManager"),
|
|
23
|
+
EngineManager: Symbol.for("EngineManager"),
|
|
24
|
+
HotUpdateManager: Symbol.for("HotUpdateManager"),
|
|
25
|
+
PromiseManager: Symbol.for("PromiseManager"),
|
|
26
|
+
PerformanceManager: Symbol.for("PerformanceManager"),
|
|
27
|
+
|
|
28
|
+
Utils: Symbol.for("Utils"),
|
|
29
|
+
Log: Symbol.for("Log"),
|
|
30
|
+
};
|
package/entry/FWEntry.ts
CHANGED
|
@@ -1,98 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import FWAudioManager from '../manager/FWAudioManager';
|
|
1
|
+
import { injectable, inject } from 'inversify';
|
|
2
|
+
import { FW_TYPES } from '../define/FWTypes';
|
|
4
3
|
import FWComponentManager from '../manager/FWComponentManager';
|
|
5
|
-
import FWEventManager from '../manager/FWEventManager';
|
|
6
|
-
import FWLanguageManager from '../manager/FWLanguageManager';
|
|
7
|
-
import { FWLayerManager } from '../manager/FWLayerManager';
|
|
8
|
-
import FWObjectManager from '../manager/FWObjectManager';
|
|
9
|
-
import { FWResManager } from '../manager/FWResManager';
|
|
10
|
-
import FWSocketManager from '../manager/FWSocketManager';
|
|
11
|
-
import { FWStateManager } from '../manager/FWStateManager';
|
|
12
|
-
import { FWTimeManager } from '../manager/FWTimeManager';
|
|
13
4
|
import { FWSocketAutoProcessPause } from '../expand/FWDecorator';
|
|
14
|
-
import FWTaskManager from '../manager/FWTaskManager';
|
|
15
|
-
import FWEngineManager from '../manager/FWEngineManager';
|
|
16
|
-
import FWHotUpdateManager from '../manager/FWHotUpdateManager';
|
|
17
|
-
import FWPromiseManager from '../manager/FWPromiseManager';
|
|
18
|
-
import { FWPerformanceManager } from '../manager/FWPerformanceManager';
|
|
19
|
-
import FWUtils from '../utils/FWUtils';
|
|
20
5
|
|
|
21
6
|
/**
|
|
22
7
|
* 入口脚本
|
|
8
|
+
* 使用依赖注入管理所有管理器实例
|
|
23
9
|
*/
|
|
10
|
+
@injectable()
|
|
24
11
|
export class FWEntry implements FW.Entry {
|
|
25
12
|
map: Map<string, FW.RegisterBundle> = new Map<string, FW.RegisterBundle>();
|
|
26
|
-
|
|
27
|
-
* 事件管理器
|
|
28
|
-
*/
|
|
29
|
-
timeMgr: FW.TimeManager;
|
|
30
|
-
/**
|
|
31
|
-
* 层级管理器
|
|
32
|
-
*/
|
|
33
|
-
layerMgr: FW.LayerManager;
|
|
34
|
-
/**
|
|
35
|
-
* 资源管理器
|
|
36
|
-
*/
|
|
37
|
-
resMgr: FW.ResManager;
|
|
38
|
-
/**
|
|
39
|
-
* 动画管理器
|
|
40
|
-
*/
|
|
41
|
-
animationMgr: FW.AnimationManager;
|
|
42
|
-
/**
|
|
43
|
-
* 状态管理器
|
|
44
|
-
*/
|
|
45
|
-
stateMgr: FW.StateManager;
|
|
46
|
-
/**
|
|
47
|
-
* 音效管理器
|
|
48
|
-
*/
|
|
49
|
-
audioMgr: FW.AudioManager;
|
|
50
|
-
/**
|
|
51
|
-
* socket管理器
|
|
52
|
-
*/
|
|
53
|
-
socketMgr: FW.SocketManager;
|
|
54
|
-
/**
|
|
55
|
-
* 对象管理器
|
|
56
|
-
*/
|
|
57
|
-
objectMgr: FW.ObjectManager;
|
|
58
|
-
/**
|
|
59
|
-
* 事件管理器
|
|
60
|
-
*/
|
|
61
|
-
evtMgr: FW.EventManager;
|
|
62
|
-
/**
|
|
63
|
-
* UI管理器
|
|
64
|
-
*/
|
|
65
|
-
uiMgr: FW.UiManager;
|
|
66
|
-
/**
|
|
67
|
-
* 任务管理器
|
|
68
|
-
*/
|
|
69
|
-
taskMgr: FW.TaskManager;
|
|
70
|
-
/**
|
|
71
|
-
* 组件管理器
|
|
72
|
-
*/
|
|
73
|
-
componentMgr: FWComponentManager;
|
|
74
|
-
/**
|
|
75
|
-
* 多语言管理器
|
|
76
|
-
*/
|
|
77
|
-
languageMgr: FW.LanguageManager;
|
|
78
|
-
/**
|
|
79
|
-
* 引擎管理器
|
|
80
|
-
*/
|
|
81
|
-
engineMgr: FW.EngineManager;
|
|
82
|
-
/**
|
|
83
|
-
* 热更新管理器
|
|
84
|
-
*/
|
|
85
|
-
hotUpdateMgr: FW.HotUpdateManager;
|
|
86
|
-
/**
|
|
87
|
-
* promise管理器
|
|
88
|
-
*/
|
|
89
|
-
promiseMgr: FW.PromiseManager;
|
|
90
|
-
/**
|
|
91
|
-
* 性能管理器
|
|
92
|
-
*/
|
|
93
|
-
performanceMgr: FW.PerformanceManager;
|
|
94
|
-
|
|
95
|
-
utils: FW.Utils;
|
|
13
|
+
|
|
96
14
|
/**
|
|
97
15
|
* 当前Scene
|
|
98
16
|
*/
|
|
@@ -101,28 +19,30 @@ export class FWEntry implements FW.Entry {
|
|
|
101
19
|
* bundle名字
|
|
102
20
|
*/
|
|
103
21
|
bundleName: string;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
@inject(FW_TYPES.TimeManager) public timeMgr: FW.TimeManager,
|
|
25
|
+
@inject(FW_TYPES.LayerManager) public layerMgr: FW.LayerManager,
|
|
26
|
+
@inject(FW_TYPES.ResManager) public resMgr: FW.ResManager,
|
|
27
|
+
@inject(FW_TYPES.AnimationManager) public animationMgr: FW.AnimationManager,
|
|
28
|
+
@inject(FW_TYPES.StateManager) public stateMgr: FW.StateManager,
|
|
29
|
+
@inject(FW_TYPES.AudioManager) public audioMgr: FW.AudioManager,
|
|
30
|
+
@inject(FW_TYPES.SocketManager) public socketMgr: FW.SocketManager,
|
|
31
|
+
@inject(FW_TYPES.ObjectManager) public objectMgr: FW.ObjectManager,
|
|
32
|
+
@inject(FW_TYPES.EventManager) public evtMgr: FW.EventManager,
|
|
33
|
+
@inject(FW_TYPES.UiManager) public uiMgr: FW.UiManager,
|
|
34
|
+
@inject(FW_TYPES.TaskManager) public taskMgr: FW.TaskManager,
|
|
35
|
+
@inject(FW_TYPES.ComponentManager) public componentMgr: FWComponentManager,
|
|
36
|
+
@inject(FW_TYPES.LanguageManager) public languageMgr: FW.LanguageManager,
|
|
37
|
+
@inject(FW_TYPES.EngineManager) public engineMgr: FW.EngineManager,
|
|
38
|
+
@inject(FW_TYPES.HotUpdateManager) public hotUpdateMgr: FW.HotUpdateManager,
|
|
39
|
+
@inject(FW_TYPES.PromiseManager) public promiseMgr: FW.PromiseManager,
|
|
40
|
+
@inject(FW_TYPES.PerformanceManager) public performanceMgr: FW.PerformanceManager,
|
|
41
|
+
@inject(FW_TYPES.Utils) public utils: FW.Utils,
|
|
42
|
+
) {}
|
|
43
|
+
|
|
44
|
+
|
|
107
45
|
initialize() {
|
|
108
|
-
this.evtMgr = new FWEventManager();
|
|
109
|
-
this.timeMgr = new FWTimeManager();
|
|
110
|
-
this.engineMgr = new FWEngineManager();
|
|
111
|
-
this.taskMgr = new FWTaskManager();
|
|
112
|
-
this.resMgr = new FWResManager();
|
|
113
|
-
this.layerMgr = new FWLayerManager();
|
|
114
|
-
this.uiMgr = new FWUiManager();
|
|
115
|
-
this.animationMgr = new FWAnimationManager();
|
|
116
|
-
this.stateMgr = new FWStateManager();
|
|
117
|
-
this.audioMgr = new FWAudioManager();
|
|
118
|
-
this.objectMgr = new FWObjectManager();
|
|
119
|
-
this.socketMgr = new FWSocketManager();
|
|
120
|
-
this.componentMgr = new FWComponentManager();
|
|
121
|
-
this.languageMgr = new FWLanguageManager();
|
|
122
|
-
this.hotUpdateMgr = new FWHotUpdateManager();
|
|
123
|
-
this.promiseMgr = new FWPromiseManager();
|
|
124
|
-
this.performanceMgr = new FWPerformanceManager();
|
|
125
|
-
this.utils = new FWUtils();
|
|
126
46
|
}
|
|
127
47
|
|
|
128
48
|
/**
|
package/log/FWLog.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
2
|
+
|
|
3
|
+
@injectable()
|
|
1
4
|
export class FWLog {
|
|
2
5
|
FWLogColorMap: Map<FW.SystemDefine.FWLogType, string> = new Map<
|
|
3
6
|
FW.SystemDefine.FWLogType,
|
|
@@ -12,15 +15,8 @@ export class FWLog {
|
|
|
12
15
|
[FW.SystemDefine.FWLogType.ERROR, '#DC3545'],
|
|
13
16
|
[FW.SystemDefine.FWLogType.SYSTEM, '#9b1eeeff'],
|
|
14
17
|
]);
|
|
15
|
-
private static instance: FWLog;
|
|
16
|
-
public static getInstance() {
|
|
17
|
-
if (!this.instance) {
|
|
18
|
-
this.instance = new FWLog();
|
|
19
|
-
}
|
|
20
|
-
return this.instance;
|
|
21
|
-
}
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
constructor() {}
|
|
24
20
|
|
|
25
21
|
public get debug() {
|
|
26
22
|
if (cc.sys.isBrowser)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { FWSkeleton } from '../animation/FWSkeleton';
|
|
2
3
|
import { FWTween } from '../animation/FWTween';
|
|
3
4
|
import { FWManager } from './FWManager';
|
|
4
5
|
import { FWAnimationMachine } from '../machine/FWAnimationMachine';
|
|
5
6
|
|
|
7
|
+
@injectable()
|
|
6
8
|
export default class FWAnimationManager extends FWManager {
|
|
7
9
|
private animationMachineMap: Map<string, FWAnimationMachine>;
|
|
8
10
|
public initialize(): void {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { injectable, inject } from 'inversify';
|
|
2
|
+
import { FW_TYPES } from '../define/FWTypes';
|
|
1
3
|
import { FWSystemConfig } from "../config/FWSystemConfig";
|
|
2
4
|
import { FWManager } from "./FWManager";
|
|
3
5
|
|
|
@@ -17,10 +19,13 @@ class FWAssetData implements FW.AssetData {
|
|
|
17
19
|
assetProperty: FW.AssetProperty;
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
@injectable()
|
|
20
23
|
export class FWAssetManager extends FWManager implements FW.AssetManager {
|
|
21
24
|
assetsMap: Map<string, FWAssetData>;
|
|
22
25
|
|
|
23
|
-
constructor(
|
|
26
|
+
constructor(
|
|
27
|
+
@inject(FW_TYPES.ResManager) protected readonly resMgr: FW.ResManager
|
|
28
|
+
) {
|
|
24
29
|
super();
|
|
25
30
|
}
|
|
26
31
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { FWManager } from "./FWManager";
|
|
2
3
|
|
|
3
4
|
class FWAudioData {
|
|
@@ -16,6 +17,7 @@ class FWAudioPoolItem {
|
|
|
16
17
|
) {}
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
@injectable()
|
|
19
21
|
export default class FWAudioManager
|
|
20
22
|
extends FWManager
|
|
21
23
|
implements FW.AudioManager
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { injectable, inject } from 'inversify';
|
|
2
|
+
import { FW_TYPES } from '../define/FWTypes';
|
|
1
3
|
import { FWManager } from "./FWManager";
|
|
2
4
|
import { FWSystemConfig } from "../config/FWSystemConfig";
|
|
3
5
|
|
|
6
|
+
@injectable()
|
|
4
7
|
export class FWBundleManager extends FWManager implements FW.BundleManager {
|
|
5
8
|
bundleMap: Map<string, cc.AssetManager.Bundle>;
|
|
6
9
|
remoteBundleConfigMap: Map<string, FW.RemoteBundleConfig>;
|
|
7
10
|
|
|
8
|
-
constructor(
|
|
11
|
+
constructor(
|
|
12
|
+
@inject(FW_TYPES.ResManager) protected readonly resMgr: FW.ResManager
|
|
13
|
+
) {
|
|
9
14
|
super();
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { injectable } from "inversify";
|
|
2
|
+
import { FWManager } from "./FWManager";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* 观察者
|
|
3
6
|
*/
|
|
@@ -86,7 +89,8 @@ class FWObserver implements FW.Observer {
|
|
|
86
89
|
/**
|
|
87
90
|
* 事件管理器
|
|
88
91
|
*/
|
|
89
|
-
|
|
92
|
+
@injectable()
|
|
93
|
+
export default class FWEventManager extends FWManager implements FW.EventManager {
|
|
90
94
|
private listeners: { [key: string]: FW.Observer[] } = cc.js.createMap();
|
|
91
95
|
|
|
92
96
|
public initialize(): void {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { FWManager } from './FWManager';
|
|
2
3
|
|
|
3
4
|
const TEMOTE_ASSET = 'remote-asset';
|
|
4
5
|
|
|
6
|
+
@injectable()
|
|
5
7
|
export default class FWHotUpdateManager extends FWManager implements FW.HotUpdateManager {
|
|
6
8
|
private listener: FW.HotUpdateListener;
|
|
7
9
|
private assetMgr: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { FWManager } from "./FWManager";
|
|
2
3
|
import { FWQueue } from "../utils/FWQueue";
|
|
3
4
|
import { FrameworkBase } from "../FrameworkBase";
|
|
@@ -5,6 +6,7 @@ import { PerformanceMonitor } from "../expand/FWDecorator";
|
|
|
5
6
|
|
|
6
7
|
const ADD_EXTERNAL_REFERENCE: string = "addExternalReference";
|
|
7
8
|
|
|
9
|
+
@injectable()
|
|
8
10
|
export class FWLayerManager extends FWManager implements FW.LayerManager {
|
|
9
11
|
private resourceManager: FWLayerResourceManager;
|
|
10
12
|
private dataManager: FWLayerDataManager;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { injectable } from 'inversify';
|
|
2
|
+
import { FWManager } from "./FWManager";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* 性能管理器
|
|
5
6
|
*/
|
|
7
|
+
@injectable()
|
|
6
8
|
export class FWPerformanceManager extends FWManager implements FW.PerformanceManager {
|
|
7
9
|
private metrics: FW.PerformanceMetric[] = [];
|
|
8
10
|
private moduleStats: Map<
|
package/manager/FWResManager.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
+
import { injectable, inject } from 'inversify';
|
|
2
|
+
import { FW_TYPES } from '../define/FWTypes';
|
|
1
3
|
import { FWSystemConfig } from "../config/FWSystemConfig";
|
|
2
4
|
import { FWLodash } from "../utils/FWLodash";
|
|
3
5
|
import { FWAssetManager } from "./FWAssetManager";
|
|
4
6
|
import { FWBundleManager } from "./FWBundleManager";
|
|
5
7
|
import { FWManager } from "./FWManager";
|
|
6
8
|
|
|
9
|
+
@injectable()
|
|
7
10
|
export class FWResManager extends FWManager implements FW.ResManager {
|
|
8
|
-
private bundleMgr: FW.BundleManager;
|
|
9
|
-
private assetMgr: FW.AssetManager;
|
|
10
11
|
private rejectHandlerListener: FW.ResRejectHandlerListener;
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
@inject(FW_TYPES.BundleManager) private bundleMgr: FW.BundleManager,
|
|
15
|
+
@inject(FW_TYPES.AssetManager) private assetMgr: FW.AssetManager,
|
|
16
|
+
) {
|
|
17
|
+
super();
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
public initialize() {
|
|
12
|
-
this.bundleMgr = new FWBundleManager(this);
|
|
13
|
-
this.assetMgr = new FWAssetManager(this);
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
registerRejectHandler(listener: FW.ResRejectHandlerListener): void {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import FWSocket from "../service/socket/FWSocket";
|
|
2
3
|
import { FWManager } from "./FWManager";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* socket管理器
|
|
6
7
|
*/
|
|
8
|
+
@injectable()
|
|
7
9
|
export default class FWSocketManager
|
|
8
10
|
extends FWManager
|
|
9
11
|
implements FW.SocketManager
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { injectable } from 'inversify';
|
|
2
|
+
import { FWManager } from "./FWManager";
|
|
2
3
|
import FWStateMachine from '../machine/FWStateMachine';
|
|
3
4
|
|
|
5
|
+
@injectable()
|
|
4
6
|
export class FWStateManager extends FWManager implements FW.StateManager {
|
|
5
7
|
private stateMap: Map<string, FWStateMachine>;
|
|
6
8
|
|
package/manager/FWTaskManager.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import FWTask from '../utils/FWTask';
|
|
2
3
|
import { FWManager } from './FWManager';
|
|
3
4
|
|
|
5
|
+
@injectable()
|
|
4
6
|
export default class FWTaskManager extends FWManager implements FW.TaskManager {
|
|
5
7
|
public initialize(): void {}
|
|
6
8
|
public onDestroy(): void {
|
package/manager/FWTimeManager.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { FWManager } from './FWManager';
|
|
2
3
|
|
|
3
4
|
class FWTimer implements FW.Timer {
|
|
@@ -21,6 +22,7 @@ class FWTimer implements FW.Timer {
|
|
|
21
22
|
/**
|
|
22
23
|
* 时间管理器
|
|
23
24
|
*/
|
|
25
|
+
@injectable()
|
|
24
26
|
export class FWTimeManager extends FWManager implements FW.TimeManager {
|
|
25
27
|
/**
|
|
26
28
|
* 时间对象合集
|
package/manager/FWUiManager.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { injectable } from 'inversify';
|
|
1
2
|
import { searchChild } from "../expand/FWDecorator";
|
|
2
3
|
import { FWManager } from "./FWManager";
|
|
3
4
|
|
|
5
|
+
@injectable()
|
|
4
6
|
export default class FWUiManager extends FWManager implements FW.UiManager {
|
|
5
7
|
private eventMap: Map<
|
|
6
8
|
number,
|
package/package.json
CHANGED