#pragma once
#include "game/components.hpp"
#include "events.hpp"
#include <guecs/ui.hpp>
#include "graphics/textures.hpp"

namespace guecs {
  Clickable make_action(guecs::Entity gui_id, game::Event event);
  Clickable make_action(guecs::Entity gui_id, game::Event event, std::any data);

  struct GrabSource {
    DinkyECS::Entity world_entity;
    std::function<void()> commit;
    std::shared_ptr<sf::Sprite> sprite = nullptr;

    DinkyECS::Entity grab();
    void setSprite(guecs::UI& gui, guecs::Entity gui_id);
    void move(sf::Vector2f pos);
  };

  struct DropTarget {
    std::function<bool(DinkyECS::Entity world_entity)> commit;
  };
}
