Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Coin.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** jetpack
4** File description:
5** The Coin.hpp
6*/
13#ifndef COIN_HPP_
14 #define COIN_HPP_
15
16 #include "utils/Jetpack.hpp"
17
18namespace Jetpack {
23 class Coin
24 {
25 public:
26 /* Constructor and destructor */
27
32 Coin(std::array<float, 2> position = {0, 0});
36 ~Coin();
37
38
39
40 /* Getter and Setter for coin information */
41
46 const std::array<float, 2> &getPosition() const;
51 const bool &isCollected() const;
56 void setCollected(bool collected);
57
58
59
60 private:
61 std::array<float, 2> _position; /* Position of the coin */
62 bool _collected = false; /* The collected status of the coin */
63 };
64}
65
66#endif /* COIN_HPP_ */
The Jetpack.hpp.
A class that represents a coin in the game.
Definition Coin.hpp:24
void setCollected(bool collected)
Set the collected status of the coin.
Definition Coin.cpp:56
Coin(std::array< float, 2 > position={0, 0})
Constructor for Coin class.
Definition Coin.cpp:20
~Coin()
Destructor for Coin class.
Definition Coin.cpp:29
const std::array< float, 2 > & getPosition() const
Gets the position of the coin.
Definition Coin.cpp:38
const bool & isCollected() const
Gets the collected status of the coin.
Definition Coin.cpp:47