2022-08-28 01:08:04 -04:00
|
|
|
#ifndef ALAI_COIN_COIN_COUNTER_H
|
|
|
|
#define ALAI_COIN_COIN_COUNTER_H
|
2022-06-25 20:54:47 -04:00
|
|
|
|
|
|
|
#include <Godot.hpp>
|
2022-07-16 18:36:38 -04:00
|
|
|
#include <Label.hpp>
|
2022-06-25 20:54:47 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
namespace alai
|
2022-06-25 20:54:47 -04:00
|
|
|
{
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief This class controls what happens when the Coin is in the collected .
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class CoinCounter : public godot::Label
|
|
|
|
{
|
|
|
|
GODOT_CLASS(CoinCounter, godot::Label)
|
|
|
|
|
|
|
|
private:
|
2022-09-01 23:21:30 -04:00
|
|
|
uint8_t coins;
|
2022-08-28 01:08:04 -04:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief This method registers classes with Godot.
|
|
|
|
*
|
|
|
|
* @details This method registers methods, properties, and signals with the Godot engine.
|
|
|
|
*/
|
|
|
|
static void _register_methods();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Construct a new CoinCounter object.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
CoinCounter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Destroy the CoinCounter object.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
~CoinCounter();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize the class from Godot.
|
|
|
|
*
|
|
|
|
* @details This method is called just once when the Godot engine connects to the instance of the class.
|
|
|
|
*/
|
|
|
|
void _init();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Called when the collected of the coin is entered.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
void _on_CoinHUD_ready();
|
|
|
|
void _on_coin_collected(int amount);
|
|
|
|
void _ready();
|
|
|
|
|
|
|
|
};
|
2022-06-25 20:54:47 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|