FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
TunableGroups.h
1#pragma once
5#include <string>
6
7namespace environment
8{
9
17inline std::string TunableGroupOf(const std::string& name)
18{
19 auto has = [&name](const char* part) { return name.find(part) != std::string::npos; };
20 for (const char* appearance : {"Visual.Weather", "Visual.Underwater", "Visual.TimeOfDay", "Visual.SkyIntensity", "Visual.Visibility",
21 "Visual.MoonStyle", "Visual.MoonSize", "Visual.MoonBrightness"}) {
22 if (name == appearance)
23 return "Appearance";
24 }
25 if (has("Waves.") || has("Foam") || has("Crest") || has("Tail") || has("WaveLod") || has("ShelterRipples"))
26 return "Waves";
27 if (has("Water") || has("Turbidity") || has("Clarity") || has("SurfaceOpacity") || has("Caustics") || has("Reflections"))
28 return "Water";
29 if (has("Fog") || has("Rain") || has("Wetness") || has("LensDrops") || has("Cloud"))
30 return "Weather";
31 return "Sky";
32}
33
36template <class Entry>
37void SetTunableGroup(Entry& entry)
38{
39 if constexpr (requires { entry.options.group; })
40 entry.options.group = TunableGroupOf(entry.name);
41}
42
43} // namespace environment
Definition FlukeAnchor.h:124
std::string TunableGroupOf(const std::string &name)
Definition TunableGroups.h:17
void SetTunableGroup(Entry &entry)
Definition TunableGroups.h:37