Refactor to use NoiseCollection instead of Noise

This commit is contained in:
Namonay
2025-05-31 19:24:57 +02:00
parent 7c5ae10e79
commit 6ebd51b76e
6 changed files with 25 additions and 9 deletions

View File

@@ -1,5 +1,8 @@
#include "Chunk.h"
#include "Maths/Vec2.h"
#include <NoiseCollection.h>
#include <Noise.h>
#include <cstdint>
#include <memory>
Noise* NoiseCollection::GetNoise(const std::string& key) const
@@ -10,3 +13,8 @@ Noise* NoiseCollection::GetNoise(const std::string& key) const
Scop::FatalError("A non existant Noise has been requested");
return nullptr;
}
const std::array<std::uint32_t, CHUNK_SIZE.y> NoiseCollection::GetBlocks(Scop::Vec2i pos)
{
return m_collection["terrain"]->GetHeight(pos);
}