()
| 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++) { |
no test coverage detected