From f942405184c2d6067fb5303b58a225edf7e452b1 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 29 Jul 2017 19:55:16 +0500 Subject: 2017-07-29 --- old/world/Block.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 old/world/Block.cpp (limited to 'old/world/Block.cpp') diff --git a/old/world/Block.cpp b/old/world/Block.cpp new file mode 100644 index 0000000..e88068a --- /dev/null +++ b/old/world/Block.cpp @@ -0,0 +1,17 @@ +#include "Block.hpp" + +Block::~Block() {} + +Block::Block(unsigned short id, unsigned char state) : id(id), state(state) {} + +Block::Block() : id(0), state(0) {} + +bool operator<(const Block &lhs, const Block &rhs) { + if (lhs.id < rhs.id) + return true; + if (lhs.id == rhs.id) { + if (lhs.state != rhs.state) + return lhs.state < rhs.state; + } + return false; +} -- cgit v1.2.3