This commit is contained in:
@@ -12,8 +12,7 @@
|
||||
Piece::Piece(Polyomino&& polyomino, Block blockType) :
|
||||
polyomino(polyomino),
|
||||
blockType(blockType),
|
||||
rotationState(NONE),
|
||||
positions(polyomino.getPositions()) {
|
||||
rotationState(NONE) {
|
||||
}
|
||||
|
||||
void Piece::rotate(Rotation rotation) {
|
||||
@@ -25,7 +24,6 @@ void Piece::rotate(Rotation rotation) {
|
||||
this->polyomino.rotateCCW();
|
||||
|
||||
this->rotationState += rotation;
|
||||
this->positions = polyomino.getPositions();
|
||||
}
|
||||
|
||||
void Piece::defaultRotation() {
|
||||
@@ -37,11 +35,10 @@ void Piece::defaultRotation() {
|
||||
this->polyomino.rotateCW();
|
||||
|
||||
this->rotationState = NONE;
|
||||
this->positions = polyomino.getPositions();
|
||||
}
|
||||
|
||||
const std::vector<Position>& Piece::getPositions() const {
|
||||
return this->positions;
|
||||
const Polyomino& Piece::getPositions() const {
|
||||
return this->polyomino;
|
||||
}
|
||||
|
||||
int Piece::getLength() const {
|
||||
|
||||
Reference in New Issue
Block a user