JungleOpenSourceProjectRepo/inc/world/block.h

50 lines
689 B
C
Raw Normal View History

#ifndef BLOCK_H
#define BLOCK_H
#include <glm/glm.hpp>
#include <map>
enum BlockType
{
2024-04-29 21:06:15 +08:00
AirBlock,
SoilBlock,
GrassBlock,
};
enum BlockFacing
{
FacingNone,
Xpos,
Xneg,
Ypos,
Yneg,
Zpos,
Zneg,
};
class Block
{
public:
2024-04-29 21:06:15 +08:00
Block(BlockType type = BlockType::AirBlock, 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
2024-04-29 21:06:15 +08:00
extern std::map<BlockType, std::vector<glm::ivec2>> block_type_texture_table;
#endif
#endif