From 2ee0f834487cfe4b6bd9424ca2715685a8db16e4 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 15 Apr 2017 15:17:53 +0500 Subject: 2017-04-15 --- Block.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Block.cpp (limited to 'Block.cpp') diff --git a/Block.cpp b/Block.cpp new file mode 100644 index 0000000..7c45e76 --- /dev/null +++ b/Block.cpp @@ -0,0 +1,29 @@ +#include "Block.hpp" + + +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() { + +} + +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; +} -- cgit v1.2.3