Silence deprecated-copy warning

This commit is contained in:
BigBahss 2021-02-14 12:37:51 -05:00
parent 7937c3fe98
commit c103142c65
2 changed files with 24 additions and 18 deletions

View file

@ -10,7 +10,8 @@ public:
Block(); Block();
Block(uint16_t); Block(uint16_t);
Block(uint16_t tile, uint16_t collision, uint16_t elevation); Block(uint16_t tile, uint16_t collision, uint16_t elevation);
Block(const Block&); Block(const Block &);
Block &operator=(const Block &);
bool operator ==(Block); bool operator ==(Block);
bool operator !=(Block); bool operator !=(Block);
uint16_t tile:10; uint16_t tile:10;

View file

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