Move files into src/

This commit is contained in:
Marcus Huderle
2018-09-26 18:33:08 -05:00
parent 911ba64637
commit 6102181738
89 changed files with 7271 additions and 7271 deletions

32
src/core/block.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include "block.h"
Block::Block() {
}
Block::Block(uint16_t word)
{
tile = word & 0x3ff;
collision = (word >> 10) & 0x3;
elevation = (word >> 12) & 0xf;
}
Block::Block(const Block &block) {
tile = block.tile;
collision = block.collision;
elevation = block.elevation;
}
uint16_t Block::rawValue() {
return static_cast<uint16_t>(
(tile & 0x3ff) +
((collision & 0x3) << 10) +
((elevation & 0xf) << 12));
}
bool Block::operator ==(Block other) {
return (tile == other.tile) && (collision == other.collision) && (elevation == other.elevation);
}
bool Block::operator !=(Block other) {
return !(operator ==(other));
}