summaryrefslogblamecommitdiffstats
path: root/src/world/Block.cpp
blob: 3cf09db67f7499af3328ca21cf8ea7e5f9150674 (plain) (tree)
1
2
3
4
5
6
7
8

                    
                  
 
                                                                                                               
 
                                                                                                   
 










                                                    
#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;
}