Arcade architecture
arcadeSnake Class Reference

A class that implements the IGameModule interface. More...

#include <arcade_snake.hpp>

Inheritance diagram for arcadeSnake:
Collaboration diagram for arcadeSnake:

Public Member Functions

 arcadeSnake ()
 Constructor for the arcadeSnake class. More...
 
 ~arcadeSnake ()
 Destructor for the arcadeSnake class. More...
 
- Public Member Functions inherited from IGameModule
 IGameModule ()=default
 Default constructor.
 
virtual ~IGameModule ()=default
 Virtual destructor.
 
virtual std::size_t getHighScore () const =0
 Get the high score of the game. More...
 
virtual void setHighScore (std::size_t highScore)=0
 Set the high score of the game. More...
 
virtual std::size_t getScore () const =0
 Get the current score of the game. More...
 
virtual void setScore (std::size_t score)=0
 Set the current score of the game. More...
 
virtual std::vector< std::shared_ptr< IEntity > > getEntities () const =0
 Get the list of entities in the game. More...
 

Private Member Functions

std::size_t getHighScore () const override
 Retrieves the high score for the game. More...
 
std::size_t getScore () const override
 Retrieves the current score of the game. More...
 
void setScore (std::size_t score) override
 Sets the score for the game. More...
 
void setHighScore (std::size_t highScore) override
 Sets the high score for the game. More...
 
std::vector< std::shared_ptr< IEntity > > getEntities () const override
 Retrieves a list of entities managed by the class. More...
 

Private Attributes

std::string _libName = "Arcade Snake"
 The name of the library.
 

Detailed Description

A class that implements the IGameModule interface.

The arcadeSnake class provides an implementation of the IGameModule interface, including methods for initialization, stopping, and retrieving the module name.

Constructor & Destructor Documentation

◆ arcadeSnake()

arcadeSnake::arcadeSnake ( )

Constructor for the arcadeSnake class.

This constructor initializes a new instance of the arcadeSnake class.

◆ ~arcadeSnake()

arcadeSnake::~arcadeSnake ( )

Destructor for the arcadeSnake class.

This destructor cleans up any resources used by the arcadeSnake class.

Member Function Documentation

◆ getEntities()

std::vector< std::shared_ptr< IEntity > > arcadeSnake::getEntities ( ) const
inlineoverrideprivatevirtual

Retrieves a list of entities managed by the class.

This function overrides the base class implementation and returns a vector of shared pointers to IEntity objects. The returned vector represents the entities currently managed by the class.

Returns
A vector of shared pointers to IEntity objects.

Implements IGameModule.

◆ getHighScore()

std::size_t arcadeSnake::getHighScore ( ) const
inlineoverrideprivatevirtual

Retrieves the high score for the game.

This function overrides the base class implementation and returns the high score achieved in the game. Currently, it always returns 0.

Returns
std::size_t The high score value.

Implements IGameModule.

◆ getScore()

std::size_t arcadeSnake::getScore ( ) const
inlineoverrideprivatevirtual

Retrieves the current score of the game.

Returns
The current score as a std::size_t.

Implements IGameModule.

◆ setHighScore()

void arcadeSnake::setHighScore ( std::size_t  highScore)
inlineoverrideprivatevirtual

Sets the high score for the game.

This function overrides the base class implementation to set the high score.

Parameters
highScoreThe new high score to be set.

Implements IGameModule.

◆ setScore()

void arcadeSnake::setScore ( std::size_t  score)
inlineoverrideprivatevirtual

Sets the score for the game.

Parameters
scoreThe score to be set, represented as a value of type std::size_t. std::size_t is an unsigned integral type typically used for sizes and counts.

Implements IGameModule.


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