Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Coin Class Reference

A class that represents a coin in the game. More...

#include <Coin.hpp>

Public Member Functions

 Coin (std::array< float, 2 > position={0, 0})
 Constructor for Coin class.
 
 ~Coin ()
 Destructor for Coin class.
 
const std::array< float, 2 > & getPosition () const
 Gets the position of the coin.
 
const bool & isCollected () const
 Gets the collected status of the coin.
 
void setCollected (bool collected)
 Set the collected status of the coin.
 

Private Attributes

std::array< float, 2 > _position
 
bool _collected = false
 

Detailed Description

A class that represents a coin in the game.

Constructor & Destructor Documentation

◆ Coin()

Coin ( std::array< float, 2 > position = {0, 0})

Constructor for Coin class.

Parameters
positionThe position of the coin

Member Function Documentation

◆ getPosition()

const std::array< float, 2 > & getPosition ( ) const

Gets the position of the coin.

Returns
The position of the coin

◆ isCollected()

const bool & isCollected ( ) const

Gets the collected status of the coin.

Returns
The collected status of the coin

◆ setCollected()

void setCollected ( bool collected)

Set the collected status of the coin.

Parameters
collectedThe collected status of the coin

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