2022-08-28 01:08:04 -04:00
|
|
|
#ifndef ALAI_COIN_COIN_COLLECTED_H
|
|
|
|
#define ALAI_COIN_COIN_COLLECTED_H
|
2022-05-24 23:17:16 -04:00
|
|
|
|
|
|
|
#include "state_machine/State.h"
|
|
|
|
|
|
|
|
#include <AnimatedSprite.hpp>
|
2022-08-28 01:08:04 -04:00
|
|
|
#include <Godot.hpp>
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
namespace alai
|
2022-05-24 23:17:16 -04:00
|
|
|
{
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief This class controls what happens when the Coin is in the collected state.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class CoinCollected : public alai::State
|
|
|
|
{
|
|
|
|
GODOT_CLASS(CoinCollected, alai::State)
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* @brief The animated sprite of the Coin.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
godot::AnimatedSprite *animated_sprite;
|
2022-05-24 23:17:16 -04:00
|
|
|
|
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();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief Construct a new CoinCollected object.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
CoinCollected();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief Destroy the CoinCollected object.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
~CoinCollected();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @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();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief Called when the collected state of the coin is entered.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void _state_enter();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief Called when the collected state of the coin is exited.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void _state_exit();
|
2022-05-24 23:17:16 -04:00
|
|
|
|
2022-08-28 01:08:04 -04:00
|
|
|
/**
|
|
|
|
* @brief Called when the animation of the collected coin has finished.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void _on_animation_finished(godot::String anim_name);
|
|
|
|
};
|
2022-05-24 23:17:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|