summaryrefslogtreecommitdiffstats
path: root/src/Block.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-02-25 13:05:18 +0100
committerGitHub <noreply@github.com>2018-02-25 13:05:18 +0100
commit55e432becc8c5a1b8dd6543cc0a26e0213aeb88f (patch)
treef5d7dea2c6dc5a3d2feb8f4c0413f83beef61793 /src/Block.hpp
parentRaycast debug render (diff)
parentmin/max functions (diff)
downloadAltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.gz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.bz2
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.lz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.xz
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.tar.zst
AltCraft-55e432becc8c5a1b8dd6543cc0a26e0213aeb88f.zip
Diffstat (limited to 'src/Block.hpp')
-rw-r--r--src/Block.hpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/Block.hpp b/src/Block.hpp
index 12d2907..cd01f9a 100644
--- a/src/Block.hpp
+++ b/src/Block.hpp
@@ -3,14 +3,13 @@
#include <functional>
struct Block {
- Block();
+ Block();
+ Block(unsigned short id, unsigned char state,
+ unsigned char light, unsigned char sky);
+ ~Block();
- Block(unsigned short id, unsigned char state, unsigned char light, unsigned char sky);
-
- ~Block();
-
- unsigned short id : 13;
- unsigned char state : 4;
+ unsigned short id : 13;
+ unsigned char state : 4;
unsigned char light : 4;
unsigned char sky : 4;
};
@@ -20,6 +19,15 @@ struct BlockId {
unsigned char state : 4;
};
+enum BlockFacing {
+ Bottom = 0,
+ Top,
+ North,
+ South,
+ West,
+ East
+};
+
bool operator==(const BlockId& lhs, const BlockId &rhs);
bool operator<(const BlockId& lhs, const BlockId &rhs);
@@ -27,8 +35,7 @@ bool operator<(const BlockId& lhs, const BlockId &rhs);
namespace std {
template <>
struct hash<BlockId> {
- std::size_t operator()(const BlockId& k) const
- {
+ std::size_t operator()(const BlockId& k) const {
size_t id = std::hash<unsigned short>()(k.id);
size_t state = std::hash<unsigned char>()(k.state);