#ifndef BEACON_POWERUP_HPP
#define BEACON_POWERUP_HPP

#include "godot_cpp/templates/vector.hpp"
#include "turret.hpp"
#include <godot_cpp/classes/area3d.hpp>

namespace godot {
//! Area3D that inverts the attack classes of any turret object that it comes into contact with. Resets effects when it is destroyed.
class BeaconPowerup : public Area3D {
    GDCLASS(BeaconPowerup, Area3D);
    //! Required to be a valid godot class.
    static void _bind_methods();
public:
    //! Connect body_entered observer.
    virtual void _enter_tree() override;
    //! Reset affected turrets.
    virtual void _exit_tree() override;
    //! If entered body is a turret, invert targets.
    void body_entered(Node3D *node);

private:
    Vector<Turret*> affected{};
};
}

#endif // !BEACON_POWERUP_HPP
