#ifndef MINIMAP_HPP_INCLUDED
#define MINIMAP_HPP_INCLUDED

#include "../../Core/Types/Tile.hpp"
#include "../../Core/Types/Point.hpp"
#include "../../Core/Classes/Region.hpp"
#include <cstdint>
#include <functional>

namespace Minimap
{
    /**
     * @brief Returns the middle point of the minimap
     *
     * @return the middle point of the minimap
     */
    Point GetMiddle();
    /**
     * @brief Returns the plane the local player is on
     *
     * @return the plane the local player is on
     */
    std::int32_t GetPlane();

    std::int32_t GetRegionID();

    /**
     * @brief Returns the tile the local player is on
     *
     * @return the tile the local player is on
     */
    Tile GetPosition();

    /**
     * @brief Returns the tile the local player is on, supports instanced regions.
     *
     * @return the tile the local player is on
     */
    Tile GetInstancePosition();

    /**
     * @brief Converts World position to global tile
     *
     * @return ..
     */
    Tile WorldToGlobal(std::int32_t X, std::int32_t Y);

    /**
     * @brief Returns the tile of the local players destination
     *
     * @return the tile of the local players destination
     */
    Tile GetDestination();

    /**
     * @brief Returns true if the local players position is close to the passed tile, uses pixels as distance
     *
     * @param T tile to check
     * @param Distance in pixels
     * @return true if the local players position is close to the passed tile
     */
    bool IsCloseTo(const Tile& T, std::int32_t Distance);
    /**
     * @brief Returns true if the passed tile is on the minimap
     *
     * @param T tile to check
     * @return true if the passed tile is on the minimap
     */
    bool IsTileOn(const Tile& T);

    /**
     * @brief When poisoned, clicks on the health orb to cure
     *
     * @return true if poisoned and  if the function successfully clicks the "Cure" option on the orb
     */
    bool ClickCure();

    /**
     * @brief Clicks on the minimap compass to quickly face North
     *
     * @return true if the function succesfully clicks the compass, and the camera angle is 0 / North
     */
    bool ClickCompass(); // Clicks north

    /**
     * @brief Clicks the quick-prayer orb
     *
     * @return true if the function succesfully clicked the orb
     */
    bool ClickQuickPrayer();

    /**
     * @brief Clicks the toggle-run orb
     *
     * @return true if the function succesfully clicked the orb
     */
    bool ClickToggleRun();
    bool ClickSpecial();

    bool ClickTile(const Tile& T, std::int32_t Random = 5);

    bool WalkPath(const std::vector<Tile>& Path, std::int32_t Distance, std::int32_t Random);
    bool WalkPath(const std::vector<Tile>& Path, std::int32_t Distance, std::int32_t Random, std::function<bool()> Func);

    bool IsReachable(const Tile& T);
}

#endif // MINIMAP_HPP_INCLUDED
