60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
// nooncraft.block: Block data in world map and general block information
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
using Block = uint8_t;
|
|
|
|
#include "item.h"
|
|
#include "render.h"
|
|
|
|
enum class Breakability: uint8_t {
|
|
Fluid,
|
|
ByAnything,
|
|
ByTool,
|
|
Unbreakable,
|
|
};
|
|
|
|
/* TODO: Generate Block IDs dynamically */
|
|
enum class BlockID: Block {
|
|
AIR = 0,
|
|
STONE = 1,
|
|
COBBLESTONE = 2,
|
|
DIRT = 3,
|
|
FLOWERS = 4,
|
|
COAL_ORE = 5,
|
|
IRON_ORE = 6,
|
|
GOLD_ORE = 7,
|
|
DIAMOND_ORE = 8,
|
|
WATER_SOURCE = 9,
|
|
OAK_LOG = 10,
|
|
OAK_PLANKS = 11,
|
|
FLOWING_WATER = 12,
|
|
GRASS = 13,
|
|
OAK_LEAVES = 14,
|
|
OAK_SAPLING = 15,
|
|
};
|
|
|
|
#define BlockID(ID) ((Block)(BlockID::ID))
|
|
|
|
/* General information on blocks */
|
|
struct BlockInfo
|
|
{
|
|
char const *name;
|
|
|
|
GlyphCluster cluster;
|
|
|
|
Breakability breakability;
|
|
ToolKind toolKind;
|
|
int16_t baseBreakDurationTicks;
|
|
bool walkable;
|
|
bool replaceable;
|
|
};
|
|
|
|
namespace Nooncraft {
|
|
|
|
BlockInfo *getBlockInfo(Block b);
|
|
|
|
} /* namespace Nooncraft */
|