ajouté classe Menu

This commit is contained in:
2025-03-01 20:27:36 +01:00
parent d443b25de1
commit 8088894073
11 changed files with 136 additions and 48 deletions

61
src/Core/Menu.h Normal file
View File

@@ -0,0 +1,61 @@
#pragma once
#include "PiecesList.h"
#include "Player.h"
#include "Game.h"
/**
* The interface between the UI and the core of the game
*/
class Menu {
private:
PiecesList piecesList; // the list of pieces in the game
Player playerControls; // the controls of the player
int boardHeight; // the height of the board for the next game
int boardWidth; // the width of the board for the next game
public:
/**
* Initializes the board size and player controls to their default values
*/
Menu();
/**
* Starts a new game with the current settings
* @return The game that has been created
*/
Game startGame(Gamemode gamemode);
/**
* Sets the width of the board, which must be greater than 0
* @return If the width has been changed
*/
bool setBoardWidth(int width);
/**
* Sets the height of the board, which must be greater than 0
* @return If the height has been changed
*/
bool setBoardHeight(int height);
/**
* @return The width of the board
*/
int getBoardWidth();
/**
* @return The height of the board
*/
int getBoardHeight();
/**
* @return A reference to the player's controls
*/
Player& getPlayerControls();
/**
* @return A reference to the pieces list
*/
PiecesList& getPiecesList();
};