MiniGame-Madness
Public Member Functions | Public Attributes | List of all members
BattleshipGame Class Reference

Class representing the Battleship game. More...

#include <BattleshipGame.h>

Collaboration diagram for BattleshipGame:
Collaboration graph
[legend]

Public Member Functions

 BattleshipGame ()
 Default constructor. Initializes the game with its own ScreenBuffer.
 
 BattleshipGame (ScreenBuffer *buffer)
 Constructor that accepts an external ScreenBuffer. More...
 
 BattleshipGame (const BattleshipGame &other)
 Copy Constructor.
 
BattleshipGameoperator= (const BattleshipGame &other)
 Copy Assignment Operator.
 
 ~BattleshipGame ()
 Destructor to clean up resources.
 
void run (std::function< std::string()> inputProvider=nullptr)
 Main function to run the Battleship game. More...
 

Public Attributes

Player player
 The human player.
 
Player ai
 The AI opponent.
 

Detailed Description

Class representing the Battleship game.

Constructor & Destructor Documentation

◆ BattleshipGame()

BattleshipGame::BattleshipGame ( ScreenBuffer buffer)

Constructor that accepts an external ScreenBuffer.

Parameters
bufferPointer to an externally provided ScreenBuffer.

Member Function Documentation

◆ run()

void BattleshipGame::run ( std::function< std::string()>  inputProvider = nullptr)

Main function to run the Battleship game.

Parameters
inputProviderFunction to provide input for testing purposes.

The documentation for this class was generated from the following files: