layers/craters/crater_placer.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "terraingen/layers/craters/crater_placer.h" | ||
| 2 | |||
| 3 | namespace terraingen { | ||
| 4 | |||
| 5 | 132 | void CraterFeatures::Append(const CraterFeatures& other) { | |
| 6 | 132 | craters.Append(other.craters); | |
| 7 | 132 | attributes.insert(attributes.end(), other.attributes.begin(), other.attributes.end()); | |
| 8 | 132 | } | |
| 9 | |||
| 10 | 119 | CraterFeatures PlacedCraters(std::span<const std::shared_ptr<const Layer>> layers, | |
| 11 | const RasterGrid& grid, double spacing) { | ||
| 12 | 119 | CraterFeatures placed; | |
| 13 | 356 | for (const auto& layer : layers) { | |
| 14 | 237 | if (const auto* placer = dynamic_cast<const CraterPlacer*>(layer.get())) { | |
| 15 | 132 | placed.Append(placer->CratersOver(grid, spacing)); | |
| 16 | } | ||
| 17 | } | ||
| 18 | 119 | return placed; | |
| 19 | } | ||
| 20 | |||
| 21 | } // namespace terraingen | ||
| 22 |