0
0
mirror of https://github.com/Nimac0/SDL_Minigame synced 2026-01-12 12:33:43 +00:00
SDL_Minigame/include/PickupComponent.h
Nimac0 4c2ddb7ff4
Some checks failed
/ deploy (push) Failing after 1m36s
Docs: add more documentation
2025-04-17 15:49:13 +02:00

22 lines
702 B
C++

#pragma once
#include <functional>
#include "Component.h"
//! \brief PickupComponent class to handle pickup events
//! \details This class manages pickup events, allowing for the registration of a callback function to be called when an entity with this component collides with another entity that has the "players" group label.
class PickupComponent : public Component
{
public:
/**
* @brief Construct a new Powerup Component object
* @param func The function to be called when the powerup is picked up
*/
PickupComponent(std::function<void (Entity*)> func);
~PickupComponent() {};
void update(uint_fast16_t diffTime) override;
private:
std::function<void (Entity*)> pickupFunc;
};