| 488 | } |
| 489 | |
| 490 | List<RectI> WorldLayout::previewAddBiomeRegion(Vec2I const& position, int width) const { |
| 491 | auto layerAndCell = findLayerAndCell(position[0], position[1]); |
| 492 | auto targetLayer = m_layers[layerAndCell.first]; |
| 493 | auto targetRegion = targetLayer.cells[layerAndCell.second]; |
| 494 | |
| 495 | int insertX = position[0] > 0 ? position[0] : 1; |
| 496 | |
| 497 | // need a dummy region to expand |
| 498 | std::shared_ptr<WorldRegion> dummyRegion; |
| 499 | |
| 500 | targetLayer.boundaries.insertAt(layerAndCell.second, insertX); |
| 501 | targetLayer.cells.insertAt(layerAndCell.second, dummyRegion); |
| 502 | |
| 503 | targetLayer.boundaries.insertAt(layerAndCell.second, insertX - 1); |
| 504 | targetLayer.cells.insertAt(layerAndCell.second, targetRegion); |
| 505 | |
| 506 | auto expandResult = expandRegionInLayer(targetLayer, layerAndCell.second + 1, width); |
| 507 | |
| 508 | return expandResult.second; |
| 509 | } |
| 510 | |
| 511 | List<RectI> WorldLayout::previewExpandBiomeRegion(Vec2I const& position, int width) const { |
| 512 | auto layerAndCell = findLayerAndCell(position[0], position[1]); |
no test coverage detected