MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / pickHueShiftFromJson

Method pickHueShiftFromJson

source/game/StarBiomeDatabase.cpp:190–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190float BiomeDatabase::pickHueShiftFromJson(Json source, uint64_t seed, String const& key) {
191 if (source.isNull())
192 return 0;
193 auto options = jsonToFloatList(source);
194 if (options.size() == 0)
195 return 0;
196 auto t = staticRandomU32(seed, key);
197 return options.at(t % options.size());
198}
199
200BiomePlaceables BiomeDatabase::readBiomePlaceables(Json const& config, uint64_t seed, float biomeHueShift) const {
201 auto& root = Root::singleton();

Callers

nothing calls this directly

Calls 5

jsonToFloatListFunction · 0.85
staticRandomU32Function · 0.85
isNullMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected