#ifndef CONTROLLERCOMPONENT_HPP
#define CONTROLLERCOMPONENT_HPP

#include "TinyMath.hpp"
#include "TransformComponent.hpp"
#include <string>

/**
 * Allows a @link GameObject @endlink to be controlled via player input.
 */
class ControllerComponent : public Component {

public:
    /**
     * Construct a new Controller Component object,
     * 
     * @param _transform the position of the containing GameObject
     * @see TransformComponent
     * @param deltaPos how much the position changes given input
     */
    ControllerComponent(TransformComponent *_transform, Vec2D deltaPos);

    /**
     * Destroy the Controller Component object.
     */
    ~ControllerComponent();

    /**
     * Uses any input in the SDL_Event to move the GameObject.
     * 
     * @param e checked for any controller input
     * @param frame irrelevant for this implementation
     * @param broadcastList irrelevant for this implementation
     */
    void Update(SDL_Event e, int frame, std::vector<std::string> broadcastList) override;

    void ShowComponentEditor(bool* showEditor) override;

    const char* ComponentTypeName() override {return "Controller Component";}

private:
    Vec2D deltaPos;
    TransformComponent *transform;
};

#endif
