./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
10 / 10
100.0%
Branches:
6 / 6
100.0%
Functions:
2 / 2
100.0%

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
1/1
✓ Branch 2 taken 126 times.
126 CraterFeatures described{std::move(craters), {}};
16
1/1
✓ Branch 1 taken 126 times.
126 described.attributes.reserve(described.craters.Size());
17
2/2
✓ Branch 0 taken 21538 times.
✓ Branch 1 taken 126 times.
21664 for (std::size_t n = 0; n < described.craters.Size(); ++n) {
18
2/2
✓ Branch 1 taken 21538 times.
✓ Branch 4 taken 21538 times.
43076 described.attributes.push_back(models.Attributes(described.craters.At(n)));
19 }
20 126 return described;
21 }
22
23 } // namespace terraingen
24