MCPcopy Create free account
hub / github.com/YGYOOO/WorldX / initialize

Method initialize

client/src/systems/PlaybackController.ts:58–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56 }
57
58 async initialize(): Promise<void> {
59 const [worldTime, worldInfo] = await Promise.all([
60 apiClient.getWorldTime(),
61 apiClient.getWorldInfo(),
62 ]);
63 this.currentTime = worldTime;
64 this.sceneConfig = worldInfo.sceneConfig;
65 if (worldInfo.currentWorldId && worldInfo.currentTimelineId) {
66 this.liveContext = {
67 worldId: worldInfo.currentWorldId,
68 timelineId: worldInfo.currentTimelineId,
69 };
70 }
71 this.globalEventBus.emit("time_update", { ...this.currentTime });
72 this.globalEventBus.emit("simulation_status", { status: "idle" });
73 this.emitPlaybackState();
74 }
75
76 getCurrentTime(): WorldTimeInfo {
77 return { ...this.currentTime };

Callers 1

initAsyncMethod · 0.45

Calls 1

emitPlaybackStateMethod · 0.95

Tested by

no test coverage detected