mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 22:53:35 +00:00
world generation
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#ifndef WORLD_H
|
||||
#define WORLD_H
|
||||
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <ScopGraphics.h>
|
||||
|
||||
#include <Chunk.h>
|
||||
#include <Utils.h>
|
||||
|
||||
class World
|
||||
{
|
||||
@@ -14,7 +15,7 @@ class World
|
||||
|
||||
[[nodiscard]] inline Scop::Scene& GetScene() noexcept { return m_scene; }
|
||||
[[nodiscard]] inline std::shared_ptr<Scop::Material> GetBlockMaterial() const { return p_block_material; }
|
||||
[[nodiscard]] Chunk& GetChunk(Scop::Vec2i position);
|
||||
[[nodiscard]] Scop::NonOwningPtr<Chunk> GetChunk(Scop::Vec2i position);
|
||||
|
||||
~World() = default;
|
||||
|
||||
@@ -22,12 +23,12 @@ class World
|
||||
void GenerateWorld();
|
||||
|
||||
private:
|
||||
static inline constexpr std::size_t CHUNKS_SIZE = 16;
|
||||
|
||||
std::vector<Chunk> m_chunks;
|
||||
static constexpr std::uint8_t RENDER_DISTANCE = 2;
|
||||
std::unordered_map<Scop::Vec2i, Chunk> m_chunks;
|
||||
std::shared_ptr<Scop::Material> p_block_material;
|
||||
Scop::Narrator& m_narrator;
|
||||
Scop::Scene& m_scene;
|
||||
Scop::Vec2i m_previous_chunk_position;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user