SyndicatQuebecoisdelaConstr.../SQCSim2021/world.h
MarcEricMartel 8e222f39a9 HALLELUJAH!
2021-11-27 13:35:39 -05:00

32 lines
787 B
C++

#ifndef WORLD_H__
#define WORLD_H__
#include "define.h"
#include "chunk.h"
#include "array2d.h"
#include "vector3.h"
#include "transformation.h"
class Chunk;
class World {
public:
World();
~World();
Array2d<Chunk*>& GetChunks();
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;
private:
Array2d<Chunk*> m_chunks = Array2d<Chunk*>(WORLD_SIZE_X, WORLD_SIZE_Y);
Array2d<Chunk*> m_buffer = Array2d<Chunk*>(WORLD_SIZE_X, WORLD_SIZE_Y);
unsigned int m_center[2] = {UINT16_MAX / 2, UINT16_MAX / 2};
};
#endif // WORLD_H__