src/layers/craters/crater_placer.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | |||
| 3 | #include "terraingen/layers/craters/crater_placer.h" | ||
| 4 | |||
| 5 | #include <utility> | ||
| 6 | |||
| 7 | namespace terraingen { | ||
| 8 | |||
| 9 | 123 | void CraterFeatures::Append(const CraterFeatures& other) { | |
| 10 | 123 | craters.Append(other.craters); | |
| 11 | 123 | attributes.insert(attributes.end(), other.attributes.begin(), other.attributes.end()); | |
| 12 | 123 | } | |
| 13 | |||
| 14 | 126 | CraterFeatures DescribeCraters(CraterList craters, const CraterShapeModels& models) { | |
| 15 | 126 | CraterFeatures described{std::move(craters), {}}; | |
| 16 | 126 | described.attributes.reserve(described.craters.Size()); | |
| 17 | 21664 | for (std::size_t n = 0; n < described.craters.Size(); ++n) { | |
| 18 | 43076 | described.attributes.push_back(models.Attributes(described.craters.At(n))); | |
| 19 | } | ||
| 20 | 126 | return described; | |
| 21 | } | ||
| 22 | |||
| 23 | } // namespace terraingen | ||
| 24 |