TheCOSCGameProject  1.0
Public Member Functions | List of all members
Game Class Referenceabstract

Abstract base class for mini-games. More...

#include <minigames.h>

Inheritance diagram for Game:
Inheritance graph
[legend]

Public Member Functions

virtual bool start ()=0
 Starts the game. More...
 
virtual ~Game ()
 Virtual destructor for proper cleanup of derived classes. More...
 
virtual std::string getGameName ()=0
 Gets the name of the game. More...
 

Detailed Description

Abstract base class for mini-games.

The Game class provides a common interface for all mini-games, enforcing the implementation of the start method and providing a way to retrieve the game's name.

Constructor & Destructor Documentation

◆ ~Game()

virtual Game::~Game ( )
inlinevirtual

Virtual destructor for proper cleanup of derived classes.

Member Function Documentation

◆ getGameName()

virtual std::string Game::getGameName ( )
pure virtual

Gets the name of the game.

Returns
A string representing the name of the game.

Implemented in BlackJack, CodeGuesser, and TicTacToe.

◆ start()

virtual bool Game::start ( )
pure virtual

Starts the game.

This is a pure virtual function that must be implemented by any derived class.

Returns
True if the game was completed successfully, otherwise false.

Implemented in BlackJack, CodeGuesser, and TicTacToe.


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