This commit is contained in:
@@ -345,7 +345,7 @@ std::ostream& operator<<(std::ostream& os, const GameBoard& gameboard) {
|
||||
// print only the position were the active piece is
|
||||
for (int y = gameboard.activePiecePosition.y + gameboard.activePiece->getLength() - 1; y >= gameboard.board.getBaseHeight(); y--) {
|
||||
for (int x = 0; x < gameboard.board.getWidth(); x++) {
|
||||
bool hasActivePiece = gameboard.activePiece->getPositions().contains(Position(x, y) - gameboard.activePiecePosition);
|
||||
bool hasActivePiece = gameboard.activePiece->containsSquare(Position(x, y) - gameboard.activePiecePosition);
|
||||
if (hasActivePiece) {
|
||||
os << "*";
|
||||
}
|
||||
@@ -361,7 +361,7 @@ std::ostream& operator<<(std::ostream& os, const GameBoard& gameboard) {
|
||||
Block pieceBlockType = (gameboard.activePiece == nullptr) ? NOTHING : gameboard.activePiece->getBlockType();
|
||||
for (int y = gameboard.board.getBaseHeight() - 1; y >= 0; y--) {
|
||||
for (int x = 0; x < gameboard.board.getWidth(); x++) {
|
||||
bool hasActivePiece = (gameboard.activePiece == nullptr) ? false : gameboard.activePiece->getPositions().contains(Position(x, y) - gameboard.activePiecePosition);
|
||||
bool hasActivePiece = (gameboard.activePiece == nullptr) ? false : gameboard.activePiece->containsSquare(Position(x, y) - gameboard.activePiecePosition);
|
||||
|
||||
// the active piece takes visual priority over the board
|
||||
if (hasActivePiece) {
|
||||
|
||||
Reference in New Issue
Block a user