Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarBiomeDatabase.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /source/game/StarBiomeDatabase.hpp
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'source/game/StarBiomeDatabase.hpp')
-rw-r--r--source/game/StarBiomeDatabase.hpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/source/game/StarBiomeDatabase.hpp b/source/game/StarBiomeDatabase.hpp
new file mode 100644
index 0000000..481e640
--- /dev/null
+++ b/source/game/StarBiomeDatabase.hpp
@@ -0,0 +1,50 @@
+#ifndef STAR_BIOME_DATABASE_HPP
+#define STAR_BIOME_DATABASE_HPP
+
+#include "StarBiome.hpp"
+#include "StarWeatherTypes.hpp"
+#include "StarSkyTypes.hpp"
+
+namespace Star {
+
+STAR_CLASS(BiomeDatabase);
+
+class BiomeDatabase {
+public:
+ BiomeDatabase();
+
+ StringList biomeNames() const;
+
+ float biomeHueShift(String const& biomeName, uint64_t seed) const;
+ WeatherPool biomeWeathers(String const& biomeName, uint64_t seed, float threatLevel) const;
+ bool biomeIsAirless(String const& biomeName) const;
+ SkyColoring biomeSkyColoring(String const& biomeName, uint64_t seed) const;
+ String biomeFriendlyName(String const& biomeName) const;
+ StringList biomeStatusEffects(String const& biomeName) const;
+ StringList biomeOres(String const& biomeName, float threatLevel) const;
+
+ StringList weatherNames() const;
+ WeatherType weatherType(String const& weatherName) const;
+
+ BiomePtr createBiome(String const& biomeName, uint64_t seed, float verticalMidPoint, float threatLevel) const;
+
+private:
+ struct Config {
+ String path;
+ String name;
+ Json parameters;
+ };
+ typedef StringMap<Config> ConfigMap;
+
+ static float pickHueShiftFromJson(Json source, uint64_t seed, String const& key);
+
+ BiomePlaceables readBiomePlaceables(Json const& config, uint64_t seed, float biomeHueShift) const;
+ List<pair<ModId, float>> readOres(Json const& oreDistribution, float threatLevel) const;
+
+ ConfigMap m_biomes;
+ ConfigMap m_weathers;
+};
+
+}
+
+#endif