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

Method simulateDay

server/src/simulation/simulation-engine.ts:185–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183 }
184
185 async simulateDay(): Promise<SimulationEvent[]> {
186 const allEvents: SimulationEvent[] = [];
187 const currentTime = this.worldManager.getCurrentTime();
188 const sceneConfig = this.worldManager.getSceneConfig();
189 const maxTicks = getBatchTicksForOneCycle({
190 sceneType: sceneConfig.sceneType,
191 startTime: sceneConfig.startTime,
192 tickDurationMinutes: sceneConfig.tickDurationMinutes,
193 maxTicks: sceneConfig.maxTicks,
194 sceneDay: currentTime.day,
195 displayFormat: sceneConfig.displayFormat,
196 multiDay: sceneConfig.multiDay,
197 });
198 for (let i = 0; i < maxTicks; i++) {
199 const events = await this.simulateTick();
200 allEvents.push(...events);
201 const gt = this.worldManager.getCurrentTime();
202 process.stdout.write(
203 `\r Day ${gt.day} Tick ${gt.tick}/${maxTicks - 1} (events: ${allEvents.length})`,
204 );
205 }
206 console.log();
207 return allEvents;
208 }
209
210 async simulateDays(count: number): Promise<void> {
211 for (let d = 0; d < count; d++) {

Callers 1

simulateDaysMethod · 0.95

Calls 4

simulateTickMethod · 0.95
getBatchTicksForOneCycleFunction · 0.85
getSceneConfigMethod · 0.80
getCurrentTimeMethod · 0.45

Tested by

no test coverage detected