use bitsets
All checks were successful
Linux arm64 / Build (push) Successful in 2m13s

This commit is contained in:
2025-07-21 16:06:27 +02:00
parent 4095103843
commit 07ba9619ed
7 changed files with 120 additions and 83 deletions

View File

@@ -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 {