JungleOpenSourceProjectRepo/inc/world/block.h

50 lines
656 B
C++

#ifndef BLOCK_H
#define BLOCK_H
#include <glm/glm.hpp>
#include <map>
enum BlockType
{
Air,
Soil,
Grass,
};
enum BlockFacing
{
FacingNone,
Xpos,
Xneg,
Ypos,
Yneg,
Zpos,
Zneg,
};
class Block
{
public:
Block(BlockType type = BlockType::Air, BlockFacing facing = BlockFacing::FacingNone) : type(type), facing(facing) {}
void set_type(BlockType type)
{
this->type = type;
}
BlockType get_type()
{
return this->type;
}
private:
BlockType type;
BlockFacing facing;
};
#ifndef WORLD
extern std::map<BlockType, glm::ivec2> block_type_texture_table;
#endif
#endif