blob: 3cf09db67f7499af3328ca21cf8ea7e5f9150674 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "Block.hpp"
Block::~Block() {}
Block::Block(unsigned short idAndState, unsigned char light) : id(idAndState >> 4), state(idAndState & 0x0F) {}
Block::Block(unsigned short id, unsigned char state, unsigned char light) : 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;
}
|