mirror of
https://github.com/motajs/template.git
synced 2026-11-02 23:14:34 +08:00
refactor: 加载系统重构
This commit is contained in:
1 parent
d12790280a
commit
cc434a6c66
27 files changed
+409
-266
No files matched your search
@@ -65,6 +65,9 @@
|
||||
"63": "Cannot create game map '$2' from raw data since the '$1' container is missing, null, or not an object.",
|
||||
"64": "Cannot create game map '$2' from raw data since the '$1' value has an invalid type or range.",
|
||||
"65": "Cannot start pathfinding movement because the mover is already active.",
|
||||
"66": "Load url '$1' error, since specified a prefixed jsonc parser, but no(or more than one) prefix split string '$2' found in response string.",
|
||||
"67": "Load url '$1' error since the raw json string splitted by prefix split string cannot be parsed to a valid JavaScript object. Parse error info: $2",
|
||||
"68": "Extra config identifier '$1' has conflicts. More than one extra config use this identifier, and the final load result is unpredictable since network decides which one to be loaded fast.",
|
||||
"2001": "Replay($1): Replay parameter count mismatch: expected $2, got $3.",
|
||||
"2002": "Replay($1): Replay parameter type mismatch: index $2, expected $3, got $4.",
|
||||
"2003": "Replay(move): Expected hero to be stopped before execute moving step.",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export * from './progress';
|
||||
export * from './manager';
|
||||
export * from './starter';
|
||||
export * from './stream';
|
||||
export * from './task';
|
||||
|
||||
@@ -49,6 +49,11 @@ export class LoadManager
|
||||
}
|
||||
|
||||
async *load(): AsyncIterable<number> {
|
||||
for (const task of this.addedTasks) {
|
||||
if (!task.contentLoaded) {
|
||||
task.start();
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
if (this.loadedTasks.size === this.addedTasks.size) {
|
||||
return;
|
||||
Reference in new issue
Block a user