44 lines
822 B
C++
44 lines
822 B
C++
#pragma once
|
|
|
|
#include "Common.h"
|
|
#include "nbt/NBT.h"
|
|
#include "Chunk.h"
|
|
#include "Palette.h"
|
|
#include "../Lockable.h"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <map>
|
|
|
|
namespace Feather
|
|
{
|
|
struct LevelData
|
|
{
|
|
int32_t spawnX, spawnY, spawnZ;
|
|
};
|
|
|
|
class World
|
|
{
|
|
public:
|
|
World(std::string name);
|
|
|
|
void PrepareSpawn();
|
|
|
|
// global palette of all block states
|
|
static const GlobalPalette<BlockState> GLOBAL_PALETTE;
|
|
|
|
Chunk* GetChunk(ChunkPos pos);
|
|
|
|
LevelData GetLevelData() const { return m_levelData; }
|
|
|
|
private:
|
|
std::unique_ptr<Chunk> LoadChunk(ChunkPos pos);
|
|
|
|
Lockable<std::map<ChunkPos, std::unique_ptr<Chunk>>> m_chunks;
|
|
|
|
LevelData m_levelData;
|
|
|
|
// TODO nuke this shit
|
|
std::string m_name;
|
|
};
|
|
} |