2021-11-15 20:58:13 -05:00
|
|
|
#ifndef WORLD_H__
|
|
|
|
#define WORLD_H__
|
|
|
|
#include "define.h"
|
|
|
|
#include "chunk.h"
|
|
|
|
#include "array2d.h"
|
|
|
|
#include "vector3.h"
|
|
|
|
#include "transformation.h"
|
|
|
|
|
2021-11-18 19:27:16 -05:00
|
|
|
class Chunk;
|
|
|
|
|
2021-11-15 20:58:13 -05:00
|
|
|
class World {
|
|
|
|
public:
|
|
|
|
World();
|
|
|
|
~World();
|
|
|
|
|
|
|
|
Array2d<Chunk*>& GetChunks();
|
|
|
|
|
2021-11-15 21:39:50 -05:00
|
|
|
Chunk* ChunkAt(float x, float y, float z) const;
|
|
|
|
Chunk* ChunkAt(const Vector3f& pos) const;
|
|
|
|
|
|
|
|
BlockType BlockAt(float x, float y, float z, BlockType defaultBlockType = BTYPE_AIR) const;
|
|
|
|
BlockType BlockAt(const Vector3f& pos, BlockType defaultBlockType = BTYPE_AIR) const;
|
2021-11-15 20:58:13 -05:00
|
|
|
|
|
|
|
private:
|
2021-11-26 11:59:02 -05:00
|
|
|
Array2d<Chunk*> m_chunks = Array2d<Chunk*>(WORLD_SIZE_X, WORLD_SIZE_Y);
|
2021-11-15 20:58:13 -05:00
|
|
|
|
2021-11-27 13:35:39 -05:00
|
|
|
unsigned int m_center[2] = {UINT16_MAX / 2, UINT16_MAX / 2};
|
2021-11-15 20:58:13 -05:00
|
|
|
};
|
2021-11-16 20:48:52 -05:00
|
|
|
#endif // WORLD_H__
|
2021-11-15 20:58:13 -05:00
|
|
|
|