#ifndef CHAT_HPP_INCLUDED
#define CHAT_HPP_INCLUDED

#include "../../Core/Classes/MessageNode.hpp"
#include <cstdint>
#include <string>
#include <vector>

/** @addtogroup Interfaces
* @{ */
class Chat
{

    public:

        typedef enum DIALOGUE_STATE
        {
            IDLE,
            CLICK_CONTINUE,
            SELECT_OPTION,
            PLEASE_WAIT,
            ENTER_AMOUNT,
            LEVEL_UP
        } DIALOGUE_STATE;

        typedef enum CHAT_TYPE
        {
            SYSTEM = 200,
            PUBLIC_CHAT = 201,
            PRIVATE_CHAT = 202,
            CLAN_CHAT = 203,

            _SYSTEM = 0,
            _PUBLIC_CHAT = 2,
            _PRIVATE_CHAT_INCOMING = 3,
            _PRIVATE_CHAT_SYSTEM = 5,
            _PRIVATE_CHAT_OUTGOING = 6,
            _CLAN_CHAT = 9,
			_CLAN_CHAT_SYSTEM = 11,
			_BROADCAST_SYSTEM = 14,
			_EXAMINE_ITEM = 27,
			_EXAMINE_NPC = 28,
			_EXAMINE_GAMEOBJECT = 29,
            _PRIVATE_CHAT_SYSTEM2 = 30,
            _AUTO_CHAT = 90,
            _TRADE_INCOMING = 101,
            _TRADE = 102
        } CHAT_TYPE;


        static std::vector<Internal::MessageNode> GetMessages(CHAT_TYPE Type);
        static std::vector<Internal::MessageNode> GetMessages(CHAT_TYPE Type, bool Sort);
        static Internal::MessageNode GetLastMessage(CHAT_TYPE Type);

        static DIALOGUE_STATE GetDialogueState();
        static std::vector<std::string> GetDialogueOptions();
        static std::string GetDialogueTitle();
        static std::string GetDialogueContent();

        static std::int32_t GetDialogueOptionIndexOf(const std::string& Option);
        static std::int32_t GetDialogueOptionIndexOf(const std::vector<std::string>& Options);

        static bool ClickContinue(bool UseKeyboard = false);
        static bool EnterAmount(std::int32_t Amount);

        static bool SelectDialogueOption(std::int32_t Index, bool UseKeyboard = false); // Index starts at 0
        static bool SelectDialogueOption(const std::string& Option, bool UseKeyboard = false);
        static bool SelectDialogueOption(const std::vector<std::string>& Options, bool UseKeyboard = false);

        static bool WaitDialogueState(std::uint32_t Duration, std::uint32_t Step, Chat::DIALOGUE_STATE State, bool Result = true); // Waits until the current chat state equals State
};

/** @} */

#endif // CHAT_HPP_INCLUDED
