allow resetting games
This commit is contained in:
@@ -16,10 +16,25 @@ GameBoard::GameBoard(int boardWidth, int boardHeight, const std::shared_ptr<Piec
|
||||
generator(pieceList),
|
||||
nextQueueLength(nextQueueLength) {
|
||||
|
||||
this->initialize();
|
||||
}
|
||||
|
||||
void GameBoard::reset() {
|
||||
this->board.clearBoard();
|
||||
this->generator.jumpToNextBag();
|
||||
|
||||
this->initialize();
|
||||
}
|
||||
|
||||
void GameBoard::initialize() {
|
||||
this->nextQueue.clear();
|
||||
for (int i = 0; i < nextQueueLength; i++) {
|
||||
this->nextQueue.push_back(this->generator.getNext());
|
||||
}
|
||||
|
||||
this->activePiece = nullptr;
|
||||
this->heldPiece = nullptr;
|
||||
this->isLastMoveKick = false;
|
||||
}
|
||||
|
||||
bool GameBoard::moveLeft() {
|
||||
|
||||
Reference in New Issue
Block a user