Added NoiseCollection

This commit is contained in:
Namonay
2025-05-30 22:22:18 +02:00
parent f53154a70a
commit dbce057f6a
2 changed files with 50 additions and 0 deletions

22
Application/NoiseCollection.h git.filemode.normal_file
View File

@@ -0,0 +1,22 @@
#ifndef NOISECOLLECTION_H
# define NOISECOLLECTION_H
#include <Noise.h>
#include <cstdint>
#include <memory>
#include <unordered_map>
class NoiseCollection
{
public:
NoiseCollection(const std::uint32_t seed);
~NoiseCollection(void) = default;
void AddNoise(const std::string& key, std::unique_ptr<Noise> noise);
Noise* GetNoise(const std::string key) const;
[[nodiscard]] std::array<std::uint32_t, CHUNK_SIZE.y> GetBlocks(Scop::Vec2i pos);
private:
std::unordered_map<std::string, std::unique_ptr<Noise>> m_collection;
};
#endif