| 185 | } |
| 186 | |
| 187 | void WorldStorage::triggerTerraformSector(Sector sector) { |
| 188 | try { |
| 189 | loadSectorToLevel(sector, SectorLoadLevel::Loaded); |
| 190 | if (auto p = m_sectorMetadata.ptr(sector)) { |
| 191 | if (p->generationLevel < SectorGenerationLevel::Complete) |
| 192 | generateSectorToLevel(sector, SectorGenerationLevel::Complete); |
| 193 | |
| 194 | p->generationLevel = SectorGenerationLevel::Terraform; |
| 195 | } else { |
| 196 | throw WorldStorageException(strf("Couldn't flag sector {} for terraforming; metadata unavailable", sector)); |
| 197 | } |
| 198 | } catch (std::exception const& e) { |
| 199 | m_db.rollback(); |
| 200 | m_db.close(); |
| 201 | throw WorldStorageException(strf("Failed to terraform sector {}", sector), e); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | RpcPromise<Vec2I> WorldStorage::enqueuePlacement(List<BiomeItemDistribution> distributions, Maybe<DungeonId> id) { |
| 206 | return m_generatorFacade->enqueuePlacement(std::move(distributions), id); |
no test coverage detected