summaryrefslogtreecommitdiffstats
path: root/Block.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-04-21 15:31:43 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-04-21 15:31:43 +0200
commit71760514fc044f273914c17b1510fa3cf10419b3 (patch)
tree72f822efde300d8e1e9de1cc578d431ff72e0e03 /Block.cpp
parent2017-04-15 (diff)
downloadAltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.gz
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.bz2
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.lz
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.xz
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.tar.zst
AltCraft-71760514fc044f273914c17b1510fa3cf10419b3.zip
Diffstat (limited to '')
-rw-r--r--Block.cpp29
1 files changed, 5 insertions, 24 deletions
diff --git a/Block.cpp b/Block.cpp
index 7c45e76..64e5330 100644
--- a/Block.cpp
+++ b/Block.cpp
@@ -1,29 +1,10 @@
#include "Block.hpp"
+Block::~Block() {}
-Block::Block(int id, unsigned char state, unsigned char light, PositionI position) : m_id(id), m_position(position),
- m_light(light), m_state(state) {
+Block::Block(unsigned short idAndState, unsigned char light) : id(idAndState >> 4), state(idAndState & 0x0F),
+ light(light) {}
-}
+Block::Block(unsigned short id, unsigned char state, unsigned char light) : id(id), state(state), light(light) {}
-Block::~Block() {
-
-}
-
-int Block::GetId() {
- return m_id;
-}
-
-int Block::GetState() {
- return m_state;
-}
-
-int Block::GetLight() {
- return m_light;
-}
-
-Block::Block(unsigned short idAndState, unsigned char light) {
- m_id = idAndState >> 4;
- m_state = idAndState & 0b00001111;
- m_light = light;
-}
+Block::Block() : id(0), state(0), light(0) {}