smarter & pointier
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user