smarter & pointier

This commit is contained in:
2025-03-03 12:00:39 +01:00
parent 47d3d929db
commit d029589c21
6 changed files with 19 additions and 10 deletions

View File

@@ -4,15 +4,19 @@
#include "Player.h"
#include "Game.h"
#include <memory>
Menu::Menu() {
this->piecesList = std::make_shared<PiecesList>(PiecesList());
// default board size
this->boardHeight = 20;
this->boardWidth = 10;
}
Game Menu::startGame(Gamemode gamemode) const {
return Game(gamemode, this->playerControls, this->boardWidth, this->boardHeight, std::make_shared<PiecesList>(this->piecesList));
return Game(gamemode, this->playerControls, this->boardWidth, this->boardHeight, this->piecesList);
}
bool Menu::setBoardWidth(int width) {
@@ -42,5 +46,5 @@ Player& Menu::getPlayerControls() {
}
PiecesList& Menu::getPiecesList() {
return this->piecesList;
return *this->piecesList;
}