diff --git a/Include/Core/Types/Convex.hpp b/Include/Core/Types/Convex.hpp index c4ceba7..e2966d5 100644 --- a/Include/Core/Types/Convex.hpp +++ b/Include/Core/Types/Convex.hpp @@ -18,7 +18,7 @@ class Convex * Default Constructor, constructs a Convex with null Vertices */ Convex(); - Convex(std::vector Vertices); + Convex(const std::vector& Vertices); /** * @brief Constructs a Convex, by copying another * @param const Convex& C The Convex to "copy" diff --git a/Include/Core/Types/Logger.hpp b/Include/Core/Types/Logger.hpp index 0d50685..f6e0531 100644 --- a/Include/Core/Types/Logger.hpp +++ b/Include/Core/Types/Logger.hpp @@ -23,7 +23,7 @@ class Logger : public std::ostream, public std::streambuf * LevelUp << "Mining" << std::endl; * @endcode */ - Logger(std::string Prefix, bool Enabled = true); + Logger(const std::string& Prefix, bool Enabled = true); /** * @brief Constructs a Logger, with a function pointer that returns a String * @param std::string (*Func)() Prefix The Prefix that's added before a message diff --git a/Include/Game/Core.hpp b/Include/Game/Core.hpp index 3810bf5..2142991 100644 --- a/Include/Game/Core.hpp +++ b/Include/Game/Core.hpp @@ -9,6 +9,7 @@ #include "Tools/Settings.hpp" #include "Tools/Widgets.hpp" #include "Tools/Worlds.hpp" +#include "Tools/RandomHandler.hpp" #include "Interfaces/Bank.hpp" #include "Interfaces/Chat.hpp" @@ -43,12 +44,12 @@ #include "Interactable/DecorativeObject.hpp" #include "Interactable/GameObject.hpp" +#include "Interactable/GroundItem.hpp" #include "Interactable/GroundObject.hpp" -#include "Interactable/WallObject.hpp" -#include "Interactable/Player.hpp" #include "Interactable/NPC.hpp" - -#include "Tools/RandomHandler.hpp" +#include "Interactable/Player.hpp" +#include "Interactable/WallObject.hpp" +#include "Interactable/Widget.hpp" // // DoxyGen diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index 6734367..a590b71 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/ObjectInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -13,15 +15,24 @@ namespace Interactable class DecorativeObject : public Internal::DecorativeObject { public: - DecorativeObject(const Internal::DecorativeObject& G); - DecorativeObject(const DecorativeObject& G); + DecorativeObject(const Internal::DecorativeObject& D); + DecorativeObject(const DecorativeObject& D); std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; Internal::ObjectInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::DecorativeObject() const; }; diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index 8984e8f..48beacd 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/ObjectInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -18,10 +20,19 @@ namespace Interactable std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; Internal::ObjectInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::GameObject() const; }; diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index 2659492..c2328e9 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -2,10 +2,12 @@ #define INTERACTABLEGROUNDITEM_HPP_INCLUDED #include "../../Core/Classes/GroundItem.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" +#include "../../Core/Classes/ItemInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -13,19 +15,26 @@ namespace Interactable class GroundItem : public Internal::GroundItem { private: - std::int32_t X; - std::int32_t Y; + Tile LocalTile; public: GroundItem(const Internal::GroundItem& G); - GroundItem(const Internal::GroundItem& G, std::int32_t X, std::int32_t Y); + GroundItem(const Internal::GroundItem& G, const Tile& LocalTile); GroundItem(const GroundItem& G); - std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; - Internal::ObjectInfo GetInfo() const; - std::vector GetModel() const; + Internal::ItemInfo GetInfo() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::GroundItem() const; }; diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 5684507..99e576e 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/ObjectInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -18,10 +20,19 @@ namespace Interactable std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; Internal::ObjectInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::GroundObject() const; }; diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index c61f6f1..3dbfffa 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/NPCInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -18,15 +20,23 @@ namespace Interactable std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; Internal::NPCInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + Internal::Character GetInteracting() const; bool Interacting() const; bool Interacting(const Internal::Character& C) const; + bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::NPC() const; }; diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index fe25e5f..bdee424 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/PlayerInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -16,14 +18,24 @@ namespace Interactable Player(const Internal::Player& P); Player(const Player& P); - Tile GetTile() const; + std::string GetName() const; Internal::PlayerInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + + std::vector GetModel() const; + double GetVisibility() const; + Tile GetTile() const; + Internal::Character GetInteracting() const; bool Interacting() const; bool Interacting(const Internal::Character& C) const; + + bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::Player() const; }; diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index 22ea5f3..e64a07e 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -5,7 +5,9 @@ #include "../../Core/Classes/ObjectInfo.hpp" #include "../../Core/Types/Tile.hpp" #include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" #include namespace Interactable @@ -13,15 +15,24 @@ namespace Interactable class WallObject : public Internal::WallObject { public: - WallObject(const Internal::WallObject& G); - WallObject(const WallObject& G); + WallObject(const Internal::WallObject& W); + WallObject(const WallObject& W); std::int32_t GetID() const; std::string GetName() const; - Tile GetTile() const; Internal::ObjectInfo GetInfo() const; - std::vector GetModel() const; + + Box GetBox() const; + Point GetPoint() const; Convex GetConvex() const; + std::vector GetModel() const; + + double GetVisibility() const; + Tile GetTile() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; operator Internal::WallObject() const; }; diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp new file mode 100644 index 0000000..60a54d1 --- /dev/null +++ b/Include/Game/Interactable/Widget.hpp @@ -0,0 +1,35 @@ +#ifndef INTERACTABLEWIDGET_HPP_INCLUDED +#define INTERACTABLEWIDGET_HPP_INCLUDED + +#include "../../Core/Classes/Widget.hpp" +#include "../../Core/Classes/ItemInfo.hpp" +#include "../../Core/Types/Tile.hpp" +#include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" +#include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" +#include + +namespace Interactable +{ + class Widget : public Internal::Widget + { + public: + Widget(const Internal::Widget& W); + Widget(const Widget& W); + + bool IsHidden() const; + std::vector GetNormalizedItemIDs() const; + + Box GetBox() const; + Point GetPoint() const; + + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option) const; + bool Interact(const std::vector& Options) const; + + operator Internal::Widget() const; + }; +} + +#endif // INTERACTABLEWIDGET_HPP_INCLUDED diff --git a/Include/Game/Interfaces/Bank.hpp b/Include/Game/Interfaces/Bank.hpp index 80a2f65..1805f7f 100644 --- a/Include/Game/Interfaces/Bank.hpp +++ b/Include/Game/Interfaces/Bank.hpp @@ -21,264 +21,53 @@ class Bank NOTED } WITHDRAW_MODE; - typedef enum REARRANGE_MODE - { - SWAP, - INSERT - } REARRANGE_MODE; - - /** - * @brief Returns true if the Bank is currently Open - * @return True if the Bank is currently Open - * @par Example - * @code - * if (Bank::IsOpen) - * return Bank::Close(); - * @endcode - */ static bool IsOpen(); - - /** - * @brief Attempts to Close the Bank if it's Currently Open, returns true if the Bank is currently Closed - * @return Returns True if the is successfully Closed, or the Bank is already Closed - * @par Example - * @code - * if (Bank::IsOpen) - * return Bank::Close(); - * @endcode - */ static bool Close(); + static bool EnterPin(); - /** - * @brief Returns an array of all Item IDs in the Bank Inventory Container - * @return An array of all Item IDs in the Bank Inventory Container - * @par Example - * @code - * std::int32_t Index = Bank::GetIndexOf(995); - * std::vector BankContainerItemIDs = Bank::GetItemIDs(); - * if ((Index != -1) && (Index <= BankContainerItemIDs.size())) - * std::cout << "Item with ID " << BankContainerItemIDs[Index] << " is in the " << Index << "th position in Bank" << std::endl; - * @endcode - * @see @ref ICLibFunctions - */ static std::vector GetItemIDs(); - /** - * @brief Returns an array of all Item Names in the Bank Inventory Container - * @return An array of all Item Names in the Bank Inventory Container - * @par Example - * @code - * std::int32_t Index = Bank::GetIndexOf("Coins"); - * std::vector BankContainerItemNames = Bank::GetItemNames(); - * if ((Index != -1) && (Index <= BankContainerItemNames.size())) - * std::cout << "Item with Name " << BankContainerItemNames[Index] << " is in the " << Index << "th position in Bank" << std::endl; - * @endcode - * @see @ref ICLibFunctions - */ static std::vector GetItemNames(); - /** - * @brief Returns an array of all Item Names in the Bank Inventory Container - * @return An array of all Item Names in the Bank Inventory Container - * @par Example - * @code - * std::int32_t Index = Bank::GetIndexOf("Coins"); - * std::vector BankContainerItemNames = Bank::GetItemNames(); - * if ((Index != -1) && (Index <= BankContainerItemNames.size())) - * std::cout << "Item with Name " << BankContainerItemNames[Index] << " is in the " << Index << "th position in Bank" << std::endl; - * @endcode - * @see @ref ICLibFunctions - */ static std::vector GetItemAmounts(); - /** - * @brief Returns the total Item Amount of the specified Item matching the passed ID in the Bank - * @return The total Item Amount of the specified Item matching the passed ID in the Bank - * @par Example - * @code - * if (Bank::GetItemAmount(995) <= 100000) - * return false; - * @endcode - */ static std::int32_t GetItemAmount(std::int32_t ID); - - /** - * @brief Returns the total Item Amount of the specified Item matching the passed Name in the Bank - * @return The total Item Amount of the specified Item matching the passed Name in the Bank - * @par Example - * @code - * if (Bank::GetItemAmount(995) <= 100000) - * return false; - * @endcode - */ static std::int32_t GetItemAmount(const std::string& Name); - /** - * @brief Returns the Index of the first occurrence of the specified Item matching the passed ID in the GetItemIDs() array - * @return The Index of the first occurrence of the specified Item matching the passed ID in the GetItemIDs() array - * @note Returns -1 if no occurrence of the specified Item matching the passed ID is found in the GetItemIDs() array - */ static std::int32_t GetIndexOf(std::int32_t ID); - - /** - * @brief Returns the Index of the first occurrence of the specified Item matching the passed Name in the GetItemIDs() array - * @return The Index of the first occurrence of the specified Item matching the passed Name in the GetItemIDs() array - * @note Returns -1 if no occurrence of the specified Item matching the passed Name is found in the GetItemIDs() array - */ static std::int32_t GetIndexOf(const std::string& Name); + static Convex GetConvexByIndex(std::int32_t Index); static Convex GetConvexOf(std::int32_t ID); static Convex GetConvexOf(const std::string& Name); - - /** - * @brief Returns true if the Bank contains the specified Item matching the passed ID - * @return True if the Bank contains the specified Item matching the passed ID - * @par Example - * @code - * if (Bank::Contains(995)) - * return Bank::WithdrawAllOf(995); - * @endcode - */ static bool Contains(std::int32_t ID); - /** - * @brief Returns true if the Bank contains the specified Item matching the passed Name - * @return True if the Bank contains the specified Item matching the passed Name - * @par Example - * @code - * if (Bank::Contains("Coins")) - * return Bank::WithdrawAllOf("Coins"); - * @endcode - */ static bool Contains(const std::string& Name); - /** - * @brief Returns true if the Bank contains all passed Item IDs, at least once - * @return True if the Bank contains all passed Item IDs, at least once - */ static bool Contains(const std::vector& IDs); - /** - * @brief Returns true if the Bank contains all passed Item Names, at least once - * @return True if the Bank contains all passed Item Item Names, at least once - */ static bool Contains(const std::vector& Names); - /** - * @brief Returns true if the Bank contains any of the passed IDs, at least once - * @return True if the Bank contains any of the passed Item IDs, at least once - */ static bool ContainsAny(const std::vector& IDs); - /** - * @brief Returns true if the Bank contains any of the passed Item Names, at least once - * @return True if the Bank contains any of the passed Item Names, at least once - */ static bool ContainsAny(const std::vector& Names); - /** - * @brief Returns true if the Bank only contains the passed Item ID - * @return True if the Bank only contains the passed Item ID - */ static bool ContainsOnly(std::int32_t ID); - /** - * @brief Returns true if the Bank only contains the passed Item Name - * @return True if the Bank only contains the passed Item Name - */ static bool ContainsOnly(const std::string& Name); - /** - * @brief Returns true if the Bank only contains the passed Item IDs - * @return True if the Bank only contains the passed Item IDs - */ static bool ContainsOnly(const std::vector& IDs); - /** - * @brief Returns true if the Bank only contains the passed Item Names - * @return True if the Bank only contains the passed Item Names - */ static bool ContainsOnly(const std::vector& Names); - /** - * @brief Returns the currently active Bank Tab - * @return The currently active Bank Tab - * @note Returns -1 if no currently active Bank Tab is found - * @par Example - * @code - * if (Bank::GetCurrentTab() == 0) - * Debug("The All tab is open"); - * @endcode - */ static std::int32_t GetCurrentTab(); - - /** - * @brief Returns the Tab Index of the specified Item matching the passed ID - * @return The Tab Index of the specified Item matching the passed ID - * @par Example - * @code - * std::int32_t TabWithCoins = Bank::GetTabOf(995); - * if (Bank::GetCurrentTab() != TabWithCoins) - * return Bank::OpenTab(TabWithCoins); - * @endcode - */ static std::int32_t GetTabOf(std::int32_t ID); - - /** - * @brief Returns the Tab Index of the specified Item Name - * @return The Tab Index of the specified Item Name - * @par Example - * @code - * std::int32_t TabWithCoins = Bank::GetTabOf("Coins"); - * if (Bank::GetCurrentTab() != TabWithCoins) - * return Bank::OpenTab(TabWithCoins); - * @endcode - */ static std::int32_t GetTabOf(const std::string& Name); - - /** - * @brief Attempts to Open the specified Bank Tab, 0 being all items - * @return True if it successfully opens the specified Bank Tab - * @par Example - * @code - * if ((Bank::IsOpen()) && (Bank::GetCurrentTab() != 0)) - * return Bank::OpenTab(0); - * @endcode - */ static bool OpenTab(std::int32_t Tab); - /** - * @brief Attempts to Scroll to the specified Item matching the passed ID - * @return True if it successfully scrolls to the specified Item matching the passed ID - * @note Returns true if the Item is already in view - * @par Example - * @code - * if (Bank::Contains(995)) - * return Bank::ScrolTo(995); - * @endcode - */ - static bool ScrollTo(std::int32_t ID); + static bool ScrollTo(std::int32_t ID, bool OpenTab = true); + static bool ScrollTo(const std::string& Name, bool OpenTab = true); - /** - * @brief Attempts to Scroll to the specified Item matching the passed Name - * @return True if it successfully scrolls to the specified Item matching the passed Name - * @note Returns true if the Item is already in view - * @par Example - * @code - * if (Bank::Contains("Coins")) - * return Bank::ScrolTo("Coins"); - * @endcode - */ - static bool ScrollTo(const std::string& Name); - /** - * @brief Attempts to Scroll to the specified Item matching the passed Name, and optionally Opens the Tab - * @return True if it successfully scrolls to the specified Item matching the passed Name - * @note Returns true if the Item is already in view - * @par Example - * @code - * if (Bank::Contains("Coins")) - * return Bank::ScrolTo("Coins"); - * @endcode - */ - static bool ScrollTo(std::int32_t ID, bool OpenTab); - static bool ScrollTo(const std::string& Name, bool OpenTab); + static bool InteractItemByIndex(std::int32_t ID, const std::string& Option); + static bool InteractItem(std::int32_t ID, const std::string& Option); + static bool InteractItem(const std::string& Name, const std::string& Option); - static bool WithdrawAllOf(std::int32_t ID); - static bool WithdrawAllOf(const std::string& Name); static bool WithdrawXOf(std::int32_t ID, std::int32_t Amount); static bool WithdrawXOf(const std::string& Name, std::int32_t Amount); + static bool WithdrawAllOf(std::int32_t ID); + static bool WithdrawAllOf(const std::string& Name); static bool WithdrawAllButOneOf(std::int32_t ID); static bool WithdrawAllButOneOf(const std::string& Name); @@ -286,15 +75,16 @@ class Bank static bool DepositAllOf(const std::string& Name); static bool DepositXOf(std::int32_t ID, std::int32_t Amount); static bool DepositXOf(const std::string& Name, std::int32_t Amount); - static bool DepositAllExcept(const std::string Name); - static bool DepositAllExcept(const std::vector Names); + static bool DepositAllExcept(const std::string& Name); + static bool DepositAllExcept(const std::vector& Names); static bool DepositAllExcept(std::int32_t ID); - static bool DepositAllExcept(const std::vector IDs); + static bool DepositAllExcept(const std::vector& IDs); + static bool DepositAll(); static bool DepositEquipment(); static WITHDRAW_MODE GetWithdrawMode(); - + static bool SetWithdrawMode(WITHDRAW_MODE Mode); }; /** @} */ diff --git a/Include/Game/Interfaces/GameTabs/Combat.hpp b/Include/Game/Interfaces/GameTabs/Combat.hpp index 1684322..875394a 100644 --- a/Include/Game/Interfaces/GameTabs/Combat.hpp +++ b/Include/Game/Interfaces/GameTabs/Combat.hpp @@ -22,7 +22,7 @@ class Combat static bool IsPoisoned(); static bool HasPoisonImmunity(); - static bool GetAutoRetaliate(); + static bool IsAutoRetaliating(); static bool ToggleAutoRetaliate(bool Toggle); static std::string GetStyle(); diff --git a/Include/Game/Interfaces/GameTabs/Equipment.hpp b/Include/Game/Interfaces/GameTabs/Equipment.hpp index 90dd8eb..fa74bc3 100644 --- a/Include/Game/Interfaces/GameTabs/Equipment.hpp +++ b/Include/Game/Interfaces/GameTabs/Equipment.hpp @@ -56,6 +56,10 @@ class Equipment static bool ContainsOnly(const std::vector& IDs); static bool ContainsOnly(const std::vector& Names); + static bool InteractItemBySlot(SLOTS Slot, const std::string& Option); + static bool InteractItem(std::int32_t ID, const std::string& Option); + static bool InteractItem(const std::string& Name, const std::string& Option); + static bool UnequipItem(SLOTS Slot); static bool UnequipItem(std::int32_t ID); static bool UnequipItem(const std::string& Name); diff --git a/Include/Game/Interfaces/GameTabs/Inventory.hpp b/Include/Game/Interfaces/GameTabs/Inventory.hpp index 2a3804a..2aaa995 100644 --- a/Include/Game/Interfaces/GameTabs/Inventory.hpp +++ b/Include/Game/Interfaces/GameTabs/Inventory.hpp @@ -48,8 +48,13 @@ class Inventory static std::vector GetIndicesOf(std::int32_t ID); static std::vector GetIndicesOf(const std::string& Name); - static Convex GetConvexOf(std::int32_t SlotIndex); + static Convex GetConvexByIndex(std::int32_t Index); + static Convex GetConvexOf(std::int32_t ID); + static Convex GetConvexOf(const std::string& Name); + static Convex GetConvexOf(const std::vector& IDs); // Returns first found ID Convex + static Convex GetConvexOf(const std::vector& Names); // Returns first found Name Convex + static Box GetBoxByIndex(std::int32_t Index); static Box GetBoxOf(std::int32_t ID); static Box GetBoxOf(const std::string& Name); static Box GetBoxOf(const std::vector& IDs); // Returns first found ID box @@ -72,25 +77,21 @@ class Inventory static bool ContainsOnly(const std::vector& IDs); static bool ContainsOnly(const std::vector& Names); - static bool InteractItemByIndex(std::int32_t Index); - static bool InteractItemByIndex(std::int32_t Index, const std::string& Action); - static bool InteractItemByIndex(std::int32_t Index, const std::vector& Actions); - - static bool InteractItem(std::int32_t ID, const std::string& Action = ""); - static bool InteractItem(const std::string& Name, const std::string& Action = ""); - static bool InteractItem(const std::vector& IDs, const std::vector& Actions); //Interacts with first found ID and Action - static bool InteractItem(const std::vector& Names, const std::vector& Actions); //Interacts with first found Name and Action + static bool InteractItemByIndex(std::int32_t Index, const std::string& Option); + static bool InteractItemByIndex(std::int32_t Index, const std::vector& Options); + static bool InteractItem(std::int32_t ID, const std::string& Option); + static bool InteractItem(const std::string& Name, const std::string& Option); + static bool InteractItem(const std::vector& IDs, const std::vector& Options); //Interacts with first found ID + static bool InteractItem(const std::vector& Names, const std::vector& Options); //Interacts with first found Name static bool DropItemByIndex(std::int32_t Index, bool AllowShiftClick = true); - static bool DropItem(std::int32_t ID, bool AllowShiftClick = true); static bool DropItem(const std::string& Name, bool AllowShiftClick = true); static bool UseItem(std::int32_t ID); static bool UseItem(const std::string& Name); - - static bool UseItemOn(std::int32_t PrimaryID, std::int32_t SecondaryID); - static bool UseItemOn(const std::string& PrimaryName, const std::string& SecondaryName); + static bool UseItemOn(std::int32_t FirstItemID, std::int32_t SecondItemID); + static bool UseItemOn(const std::string& FirstItemName, const std::string& SecondItemName); }; /** @} */ diff --git a/Include/Game/Interfaces/GameTabs/Logout.hpp b/Include/Game/Interfaces/GameTabs/Logout.hpp index 0e965f2..5de4f1a 100644 --- a/Include/Game/Interfaces/GameTabs/Logout.hpp +++ b/Include/Game/Interfaces/GameTabs/Logout.hpp @@ -17,17 +17,17 @@ class Logout static bool LogoutPlayer(); static bool IsWorldSwitcherOpen(); - static bool OpenWorldSwitcher(bool OpenInventory = false); + static bool OpenWorldSwitcher(); static bool WorldSwitcherScrollTo(Internal::World World); static bool WorldSwitcherScrollTo(std::int32_t WorldID); - static bool SwitchWorld(Internal::World World); + static bool SwitchWorld(const Internal::World& World); static bool SwitchWorld(std::int32_t WorldID); static std::vector GetFavoriteWorlds(); - static Internal::Widget GetWorldWidget(Internal::World World); + static Internal::Widget GetWorldWidget(const Internal::World& World); static Internal::Widget GetWorldWidget(std::int32_t WorldID); static Internal::Widget GetFavoriteWorldWidget(std::int32_t WorldID); }; diff --git a/Include/Game/Interfaces/GameTabs/Quests.hpp b/Include/Game/Interfaces/GameTabs/Quests.hpp index 94d1263..d07af4b 100644 --- a/Include/Game/Interfaces/GameTabs/Quests.hpp +++ b/Include/Game/Interfaces/GameTabs/Quests.hpp @@ -6,6 +6,7 @@ class Quests { public: + static bool IsOpen(); static bool Open(); }; diff --git a/Include/Game/Interfaces/Mainscreen.hpp b/Include/Game/Interfaces/Mainscreen.hpp index e103286..bce265a 100644 --- a/Include/Game/Interfaces/Mainscreen.hpp +++ b/Include/Game/Interfaces/Mainscreen.hpp @@ -22,7 +22,15 @@ class Mainscreen PLAYING } SCREEN_STATE; + typedef enum CROSSHAIR_STATE + { + NONE, + YELLOW, + RED + } CROSSHAIR_STATE; + static Mainscreen::SCREEN_STATE GetState(); + static Mainscreen::CROSSHAIR_STATE GetCrosshairState(); static bool IsLoggedIn(); static bool IsPlaying(); @@ -35,17 +43,11 @@ class Mainscreen static bool WaitIsUpText(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); static bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); - static Internal::Character GetInteractingByIndex(std::uint32_t Index); - static Internal::Character GetInteracting(); //Returns the Character interacting with the Local Player - static Internal::Character GetInteractingWith(const Internal::Character& C); //Returns the Character interactinng with the Character - - static bool IsInteracting(const Internal::Character& A, const Internal::Character& B); // True if A is interacting with B - - static std::int32_t CameraX(); - static std::int32_t CameraY(); - static std::int32_t CameraZ(); - static std::int32_t CameraPitch(); - static std::int32_t CameraYaw(); + static std::int32_t GetCameraX(); + static std::int32_t GetCameraY(); + static std::int32_t GetCameraZ(); + static std::int32_t GetCameraPitch(); + static std::int32_t GetCameraYaw(); static bool SetCameraPitch(std::int32_t Pitch); }; diff --git a/Include/Game/Interfaces/Menu.hpp b/Include/Game/Interfaces/Menu.hpp index 26f163e..1976f4a 100644 --- a/Include/Game/Interfaces/Menu.hpp +++ b/Include/Game/Interfaces/Menu.hpp @@ -11,39 +11,253 @@ class Menu { public: - + + /** + * @brief Returns true if the right-click menu is open + * + * @return true if the right-click menu is open + */ static bool IsOpen(); + + /** + * @brief Opens the menu by right-clicking wherever the mouse currently is + * + * @return true if the menu is currently open or opened by right clicking + * @return false if WaitFunc fails - WaitFunc(1000, 100, Menu::IsOpen, true); + * @note Implements an %Interactable delay if succesful + */ static bool Open(); + /** + * @brief Closes the menu by moving the mouse to either left or right of the menu, uses the current mouse position as a base point + * + * @return true if the menu isn't open, or closed by moving the mouse + * @return false if the generated point is off-screen, or WaitFunc fails - WaitFunc(1000, 100, Menu::IsOpen, false); + * @note Implements an %Interactable delay if succesful + */ + static bool Close(); + + + /** + * @brief Get the number of menu options + * + * @return the number of menu options + */ static std::int32_t GetCount(); + + /** + * @brief Get the raw, un-filtered menu actions + * + * @description By default the game includes html code in menu actions/targets + * This function returns those actions without the removal of the html code + * + * @return std::vector + */ static std::vector GetActionsRaw(); - static std::vector GetActions(); + + /** + * @brief Get the raw, un-filtered menu targets + * + * @description By default the game includes html code in menu actions/targets + * This function returns those targets without the removal of the html code + * + * @return std::vector + */ static std::vector GetTargetsRaw(); + + /** + * @brief Get the menu actions + * + * @description Actions are almost always the very first word in a menu option + * 'Use' - action 'gold bar' - target + * 'Attack' - action 'Guard (level-21)' - target + * + * @return std::vector array of menu actions + */ + static std::vector GetActions(); + + /** + * @brief Get the menu targets + * + * @description Targets are almost always everything after the action + * 'Use' - action 'gold bar' - target + * 'Attack' - action 'Guard (level-21)' - target + * + * @return std::vector array of menu targets + */ static std::vector GetTargets(); + + /** + * @brief Get the menu options + * + * @description + * 'Use' - action 'gold bar' - target + * 'Attack' - action 'Guard (level-21)' - target + * 'Use gold bar' - option + * 'Attack Guard (level-21)' - option + * @return std::vector array of menu options + */ static std::vector GetOptions(); - static std::int32_t IndexOf(const std::string& Action); - static std::int32_t IndexOf(const std::string& Action, const std::string& Target); - static std::int32_t IndexOf(const std::vector& PossibleActions); - static std::int32_t IndexOf(const std::vector& PossibleActions, const std::vector& PossibleTargets); - static bool Contains(const std::string& Action); - static bool Contains(const std::string& Action, const std::string& Target); - static bool Contains(const std::vector& PossibleActions); - static bool Contains(const std::vector& PossibleActions, const std::vector& Targets); + /** + * @brief Get the index of the found option + * + * @description This function will find the first menu option containing the string 'Option' + * This means passing 'Att' or 'Attack' will return the first found menu option containing 'Att' or 'Attack' + * If you want to find a very specific menu option, the more the 'Option' string contains, the more specific it'll be + * + * Say for example, you want to attack a guard whose level is 40, and on this one tile, there's 5 different guards, all with different levels + * If you pass 'Attack' as the 'Option' to look for, it'll select the very first guard, regardless of level. + * If you pass 'Attack Guard (level-40)' as the 'Option' to look for, it'll attack the guard whose level is 40. + * + * @note Notice that 'Attack Guard (level-40)' has a double space after 'Guard', menu options can vary, in this case the menu option i'm looking for + * has a double space after 'Guard'. + * + * @param Option Menu option to look for, can be very specific, or very lenient + * @return std::int32_t The index of the found option, -1 if an option wasn't found + */ + static std::int32_t IndexOf(const std::string& Option); - static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string& Action); - static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string& Action, const std::string& Target); - static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::vector& PossibleActions); // Waits until the Menu contains at least one of these actions - static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::vector& PossibleActions, const std::vector& PossibleTargets); // Waits until the Menu contains at least one of these actions and Targets + /** + * @brief Get the index of the first found option + * + * @description This function will return the first found index, of the first found option. + * This function is just Menu::IndexOf(const std::string& Option), but instead of looking for one single option, this function can look for multiple + * + * @param Options + * @return std::int32_t The index of the first found option, -1 if an option wasn't found + * @see Menu::IndexOf(const std::string& Option) + */ + static std::int32_t IndexOf(const std::vector& Options); - static bool Select(std::uint32_t Index); - static bool Select(const std::string& Action); - static bool Select(const std::string& Action, const std::string& Target); - static bool Select(const std::vector& PossibleActions); - static bool Select(const std::vector& PossibleActions, const std::vector& PossibleTargets); - static std::vector GetBoxes(); + /** + * @brief Looks for a menu option at the passed index, and returns information about the found option + * + * @param Index The index of the menu option to look at + * @return std::tuple + * bool [0] = Found option at index was found in menu options (should be always true if something was found at index) + * std::string [1] = Action that was found at index + * std::string [2] = Target that was found at index + * @see Menu::IndexOf(const std::string& Option) + */ + static std::tuple FindOption(std::uint32_t Index); + + /** + * @brief Looks for a menu option containing the passed Option, and returns information about the found option + * + * @param Option Menu option to look for, the more specific, the more accurate the result will be + * @return std::tuple + * bool [0] = Option was found in the Menu options + * std::string [1] = Action that was found + * std::string [2] = Target that was found + * @see Menu::IndexOf(const std::string& Option) + */ + static std::tuple FindOption(const std::string& Option); + + /** + * @brief Looks for a menu option containing the passed Option, and returns information about the found option + * + * @param Options Menu options to look for, returns on first option found, the more specific, the more accurate the result will be + * @return std::tuple + * bool [0] = Option was found in the Menu options + * std::string [1] = Action that was found + * std::string [2] = Target that was found + * @see Menu::IndexOf(const std::string& Option) + */ + static std::tuple FindOption(const std::vector& Options); + + + /** + * @brief Returns true if the menu contains the passed Option + * + * @param Option Menu option to look for, the more specific, the more accurate the result will be + * @return true if the menu contains the passed Option + * @see Menu::IndexOf(const std::string& Option) + */ + static bool Contains(const std::string& Option); + + /** + * @brief Returns true if the menu contains at least one of the passed Options + * + * @param Options Menu options to check for, returns on first option found, the more specific, the more accurate the result will be + * @return true if the menu contains at least one of the passed Options + * @see Menu::IndexOf(const std::string& Option) + */ + static bool Contains(const std::vector& Options); + + + /** + * @brief Waits until the menu contains the passed option + * + * @param Duration How long to wait until returning + * @param Step How long to wait until it checks the menu options + * @param Option Option to look for, the more specific, the more accurate the result will be + * @return true if the option was found + * @return false if the function doesn't find the passed option after running for Duration + */ + static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::string& Option); + + /** + * @brief Waits until the menu contains at leaset one of the passed options + * + * @param Duration How long to wait until returning + * @param Step How long to wait until it checks the menu options + * @param Options Options to look for, returns on first option found, the more specific, the more accurate the result will be + * @return true if at least one of the options was found + * @return false if the function doesn't find at least one of the passed options after running for Duration + */ + static bool WaitContains(std::uint32_t Duration, std::uint32_t Step, const std::vector& Options); + + + /** + * @brief Selects the menu option by the passed index if the menu is open + * + * @param Index The index of the option + * @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default + * @return true if the function selected the option by index + * @return false if the index was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @note Implements an %Interactable delay if succesful + */ + static bool Select(std::int32_t Index, bool CloseMenu = true); + + /** + * @brief Selects the passed menu option if the menu is open + * + * @param Option Menu option to look for, the more specific, the more accurate the result will be + * @param CloseMenu Close the menu if the function fails by using Menu::Close(), true by default + * @return true if the function selected the option by option + * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @note Implements an %Interactable delay if succesful + * @see Menu::IndexOf(const std::string& Option) + */ + static bool Select(const std::string& Option, bool CloseMenu = true); + + /** + * @brief Selects the first found option in the menu + * + * @param Options String array of menu options to look for, returns on first option found, the more specific, the more accurate the result will be + * @param CloseMenu Close the menu if the function fails using Menu::Close(), true by default + * @return true if the function selected the option by the first found option + * @return false if the menu isn't open, the found option was invalid, the option was off-screen, or the WaitFunc failed - WaitFunc(1000, 100, Menu::IsOpen, false) + * @note Implements an %Interactable delay if succesful + */ + static bool Select(const std::vector& Options, bool CloseMenu = true); + + + /** + * @brief Get the array of menu option boxes, each box is a menu option + * + * @return std::vector array of menu option boxes, menu must be open + */ + static std::vector GetOptionBoxes(); + + /** + * @brief Get the full menu box + * + * @return Box of the full menu, menu must be open + */ static Box GetBox(); }; diff --git a/Include/Game/Models/DecorativeObjects.hpp b/Include/Game/Models/DecorativeObjects.hpp index bc010e3..9c9a847 100644 --- a/Include/Game/Models/DecorativeObjects.hpp +++ b/Include/Game/Models/DecorativeObjects.hpp @@ -1,10 +1,7 @@ #ifndef DECORATIVEOBJECTS_HPP_INCLUDED #define DECORATIVEOBJECTS_HPP_INCLUDED -#include "../../Core/Classes/DecorativeObject.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/DecorativeObject.hpp" #include #include #include @@ -16,25 +13,20 @@ class DecorativeObjects { public: - static Internal::ObjectInfo GetInfoOf(const Internal::DecorativeObject& D); - static Tile GetTileOf(const Internal::DecorativeObject& D); - static std::vector GetModelOf(const Internal::DecorativeObject& D); - static Convex GetConvexOf(const Internal::DecorativeObject& D); + static std::vector GetAll(); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - //consider changing to Interactable::GameObject - static std::vector GetAll(); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& PossibleIDs); - static std::vector GetAll(const std::vector& PossibleNames); - static std::vector GetAll(const std::function& Filter); - - static Internal::DecorativeObject Get(const Tile& T); - static Internal::DecorativeObject Get(std::int32_t ID); - static Internal::DecorativeObject Get(const std::string& Name); - static Internal::DecorativeObject Get(const std::vector& PossibleIDs); - static Internal::DecorativeObject Get(const std::vector& PossibleNames); - static Internal::DecorativeObject Get(const std::function& Filter); + static Interactable::DecorativeObject Get(); + static Interactable::DecorativeObject Get(const Tile& T); + static Interactable::DecorativeObject Get(std::int32_t ID); + static Interactable::DecorativeObject Get(const std::string& Name); + static Interactable::DecorativeObject Get(const std::vector& IDs); + static Interactable::DecorativeObject Get(const std::vector& Names); + static Interactable::DecorativeObject Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/GameObjects.hpp b/Include/Game/Models/GameObjects.hpp index b0a0d66..359e969 100644 --- a/Include/Game/Models/GameObjects.hpp +++ b/Include/Game/Models/GameObjects.hpp @@ -1,10 +1,7 @@ #ifndef GAMEOBJECTS_HPP_INCLUDED #define GAMEOBJECTS_HPP_INCLUDED -#include "../../Core/Classes/GameObject.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/GameObject.hpp" #include #include #include @@ -16,26 +13,21 @@ class GameObjects { public: - static Internal::ObjectInfo GetInfoOf(const Internal::GameObject& G); - static Tile GetTileOf(const Internal::GameObject& G); - static std::vector GetModelOf(const Internal::GameObject& G); - static Convex GetConvexOf(const Internal::GameObject& G); + static std::vector GetAll(); + static std::vector GetAll(const Tile& T); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - //consider changing to Interactable::GameObject - static std::vector GetAll(); - static std::vector GetAll(const Tile& T); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& PossibleIDs); - static std::vector GetAll(const std::vector& PossibleNames); - static std::vector GetAll(const std::function& Filter); - - static Internal::GameObject Get(const Tile& T); - static Internal::GameObject Get(std::int32_t ID); - static Internal::GameObject Get(const std::string& Name); - static Internal::GameObject Get(const std::vector& PossibleIDs); - static Internal::GameObject Get(const std::vector& PossibleNames); - static Internal::GameObject Get(const std::function& Filter); + static Interactable::GameObject Get(); + static Interactable::GameObject Get(const Tile& T); + static Interactable::GameObject Get(std::int32_t ID); + static Interactable::GameObject Get(const std::string& Name); + static Interactable::GameObject Get(const std::vector& IDs); + static Interactable::GameObject Get(const std::vector& Names); + static Interactable::GameObject Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/GroundItems.hpp b/Include/Game/Models/GroundItems.hpp index 853c9a6..82fabbb 100644 --- a/Include/Game/Models/GroundItems.hpp +++ b/Include/Game/Models/GroundItems.hpp @@ -1,9 +1,7 @@ #ifndef GROUNDITEMS_HPP_INCLUDED #define GROUNDITEMS_HPP_INCLUDED -#include "../../Core/Classes/GroundItem.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/GroundItem.hpp" #include #include #include @@ -14,23 +12,22 @@ class GroundItems { public: - static std::vector GetAll(); - static std::vector GetAll(Tile T); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& IDs); - static std::vector GetAll(const std::vector& Names); - static std::vector GetAll(const std::function& Filter); - static Internal::GroundItem Get(Tile T); - static Internal::GroundItem Get(std::int32_t ID); - static Internal::GroundItem Get(const std::string& Name); - static Internal::GroundItem Get(const std::vector& IDs); - static Internal::GroundItem Get(const std::vector& Names); + static std::vector GetAll(); + static std::vector GetAll(const Tile& T); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - static Tile GetTileOf(Internal::GroundItem G); - - static Convex GetConvexOf(Internal::GroundItem G); + static Interactable::GroundItem Get(); + static Interactable::GroundItem Get(const Tile& T); + static Interactable::GroundItem Get(std::int32_t ID); + static Interactable::GroundItem Get(const std::string& Name); + static Interactable::GroundItem Get(const std::vector& IDs); + static Interactable::GroundItem Get(const std::vector& Names); + static Interactable::GroundItem Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/GroundObjects.hpp b/Include/Game/Models/GroundObjects.hpp index b4b385c..d16edac 100644 --- a/Include/Game/Models/GroundObjects.hpp +++ b/Include/Game/Models/GroundObjects.hpp @@ -1,10 +1,7 @@ #ifndef GROUNDOBJECTS_HPP_INCLUDED #define GROUNDOBJECTS_HPP_INCLUDED -#include "../../Core/Classes/GroundObject.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/GroundObject.hpp" #include #include #include @@ -16,25 +13,20 @@ class GroundObjects { public: - static Internal::ObjectInfo GetInfoOf(const Internal::GroundObject& G); - static Tile GetTileOf(const Internal::GroundObject& G); - static std::vector GetModelOf(const Internal::GroundObject& G); - static Convex GetConvexOf(const Internal::GroundObject& G); + static std::vector GetAll(); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - //consider changing to Interactable::GameObject - static std::vector GetAll(); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& PossibleIDs); - static std::vector GetAll(const std::vector& PossibleNames); - static std::vector GetAll(const std::function& Filter); - - static Internal::GroundObject Get(const Tile& T); - static Internal::GroundObject Get(std::int32_t ID); - static Internal::GroundObject Get(const std::string& Name); - static Internal::GroundObject Get(const std::vector& PossibleIDs); - static Internal::GroundObject Get(const std::vector& PossibleNames); - static Internal::GroundObject Get(const std::function& Filter); + static Interactable::GroundObject Get(); + static Interactable::GroundObject Get(const Tile& T); + static Interactable::GroundObject Get(std::int32_t ID); + static Interactable::GroundObject Get(const std::string& Name); + static Interactable::GroundObject Get(const std::vector& IDs); + static Interactable::GroundObject Get(const std::vector& Names); + static Interactable::GroundObject Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/NPCs.hpp b/Include/Game/Models/NPCs.hpp index 85db23b..ab260be 100644 --- a/Include/Game/Models/NPCs.hpp +++ b/Include/Game/Models/NPCs.hpp @@ -1,9 +1,7 @@ #ifndef NPCS_HPP_INCLUDED #define NPCS_HPP_INCLUDED -#include "../../Core/Classes/NPC.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/NPC.hpp" #include #include #include @@ -15,25 +13,22 @@ class NPCs { public: - static std::vector GetAll(); - static std::vector GetAll(const Tile& Tile); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& IDs); - static std::vector GetAll(const std::vector& Names); - static std::vector GetAll(const std::function& Filter); - static Internal::NPC Get(); - static Internal::NPC Get(const Tile& Tile); - static Internal::NPC Get(std::int32_t ID); - static Internal::NPC Get(const std::string& Name); - static Internal::NPC Get(const std::vector& IDs); - static Internal::NPC Get(const std::vector& Names); - static Internal::NPC Get(const std::function& Filter); + static std::vector GetAll(); + static std::vector GetAll(const Tile& Tile); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - static Tile GetTileOf(const Internal::NPC& NPC); - - static Convex GetConvexOf(const Internal::NPC& NPC); + static Interactable::NPC Get(); + static Interactable::NPC Get(const Tile& Tile); + static Interactable::NPC Get(std::int32_t ID); + static Interactable::NPC Get(const std::string& Name); + static Interactable::NPC Get(const std::vector& IDs); + static Interactable::NPC Get(const std::vector& Names); + static Interactable::NPC Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/Players.hpp b/Include/Game/Models/Players.hpp index 1b8d8c5..18b926a 100644 --- a/Include/Game/Models/Players.hpp +++ b/Include/Game/Models/Players.hpp @@ -1,9 +1,7 @@ #ifndef PLAYERS_HPP_INCLUDED #define PLAYERS_HPP_INCLUDED -#include "../../Core/Classes/Player.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/Player.hpp" #include #include #include @@ -14,22 +12,19 @@ class Players { public: - static Internal::Player GetLocal(); - static std::vector GetAll(); - static std::vector GetAll(const Tile& Tile); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& Names); - static std::vector GetAll(const std::function& Filter); + + static Interactable::Player GetLocal(); + static std::vector GetAll(); + static std::vector GetAll(const Tile& Tile); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - static Internal::Player Get(); - static Internal::Player Get(const Tile& Tile); - static Internal::Player Get(const std::string& Name); - static Internal::Player Get(const std::vector& Names); - static Internal::Player Get(const std::function& Filter); - - static Tile GetTileOf(const Internal::Player& P); - - static Convex GetConvexOf(const Internal::Player& P); + static Interactable::Player Get(); + static Interactable::Player Get(const Tile& Tile); + static Interactable::Player Get(const std::string& Name); + static Interactable::Player Get(const std::vector& Names); + static Interactable::Player Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Models/WallObjects.hpp b/Include/Game/Models/WallObjects.hpp index 9445d36..33cbead 100644 --- a/Include/Game/Models/WallObjects.hpp +++ b/Include/Game/Models/WallObjects.hpp @@ -1,10 +1,7 @@ #ifndef WALLOBJECTS_HPP_INCLUDED #define WALLOBJECTS_HPP_INCLUDED -#include "../../Core/Classes/WallObject.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/WallObject.hpp" #include #include #include @@ -16,25 +13,20 @@ class WallObjects { public: - static Internal::ObjectInfo GetInfoOf(const Internal::WallObject& W); - static Tile GetTileOf(const Internal::WallObject& W); - static std::vector GetModelOf(const Internal::WallObject& W); - static Convex GetConvexOf(const Internal::WallObject& W); + static std::vector GetAll(); + static std::vector GetAll(std::int32_t ID); + static std::vector GetAll(const std::string& Name); + static std::vector GetAll(const std::vector& IDs); + static std::vector GetAll(const std::vector& Names); + static std::vector GetAll(const std::function& Filter); - //consider changing to Interactable::GameObject - static std::vector GetAll(); - static std::vector GetAll(std::int32_t ID); - static std::vector GetAll(const std::string& Name); - static std::vector GetAll(const std::vector& PossibleIDs); - static std::vector GetAll(const std::vector& PossibleNames); - static std::vector GetAll(const std::function& Filter); - - static Internal::WallObject Get(const Tile& T); - static Internal::WallObject Get(std::int32_t ID); - static Internal::WallObject Get(const std::string& Name); - static Internal::WallObject Get(const std::vector& PossibleIDs); - static Internal::WallObject Get(const std::vector& PossibleNames); - static Internal::WallObject Get(const std::function& Filter); + static Interactable::WallObject Get(); + static Interactable::WallObject Get(const Tile& T); + static Interactable::WallObject Get(std::int32_t ID); + static Interactable::WallObject Get(const std::string& Name); + static Interactable::WallObject Get(const std::vector& IDs); + static Interactable::WallObject Get(const std::vector& Names); + static Interactable::WallObject Get(const std::function& Filter); }; /** @} */ diff --git a/Include/Game/Tools/Interact.hpp b/Include/Game/Tools/Interact.hpp index f2e3aa8..4b9f068 100644 --- a/Include/Game/Tools/Interact.hpp +++ b/Include/Game/Tools/Interact.hpp @@ -12,62 +12,31 @@ class Interact { public: - static bool MoveMouse(Point P); - static bool MoveMouse(Box B); - static bool Scroll(ScrollDirection Direction); - static bool Scroll(Point P, ScrollDirection Direction); - static bool Scroll(Box B, ScrollDirection Direction); - static bool ScrollUntil(ScrollDirection Direction, std::int32_t Duration, const std::function& Func); + static bool MoveMouse(const Point& P); + static bool MoveMouse(const Box& B); - static bool Click(Button Button = BUTTON_LEFT); + static bool Click(const Button& B = BUTTON_LEFT); - static bool Click(Point P, Button Button = BUTTON_LEFT); - static bool Click(Point P, const std::string& Action, const std::string& Target = ""); - static bool Click(Point P, const std::vector& PossibleActions, const std::vector& PossibleTargets = {""}); + static bool Click(const Point& P, const Button& B = BUTTON_LEFT); + static bool Click(const Point& P, const std::string& Option); + static bool Click(const Point& P, const std::vector& Options); - static bool Click(Box B, Button Button = BUTTON_LEFT); - static bool Click(Box B, const std::string& Action, const std::string& Target = ""); - static bool Click(Box B, const std::vector& PossibleActions, const std::vector& PossibleTargets = {""}); + static bool Click(const Box& B, const Button& Button = BUTTON_LEFT); + static bool Click(const Box& B, const std::string& Option); + static bool Click(const Box& B, const std::vector& Options); - static bool Click(Internal::Widget W, Button Button = BUTTON_LEFT); - static bool Click(Internal::Widget W, const std::string& Action, const std::string& Target = ""); - static bool Click(Internal::Widget W, const std::vector& PossibleActions, const std::vector& PossibleTargets = {""}); + static bool Click(const Convex& C, const Button& B = BUTTON_LEFT); + static bool Click(const Convex& C, const std::string& Option); + static bool Click(const Convex& C, const std::vector& Options); - static bool Click(Convex C, Button Button = BUTTON_LEFT); - static bool Click(Convex C, const std::string& Action, const std::string& Target = ""); - static bool Click(Convex C, const std::vector& PossibleActions, const std::vector& PossibleTargets = {""}); - - static bool Click(Internal::GroundItem G, Button Button = BUTTON_LEFT); - static bool Click(Internal::GroundItem G, const std::string& Action); - static bool Click(Internal::GroundItem G, const std::vector& PossibleActions); - - static bool Click(Internal::NPC N, Button Button = BUTTON_LEFT); - static bool Click(Internal::NPC N, const std::string& Action); - static bool Click(Internal::NPC N, const std::vector& PossibleActions); - - static bool Click(Internal::Player P, Button Button = BUTTON_LEFT); - static bool Click(Internal::Player P, const std::string& Action); - static bool Click(Internal::Player P, const std::vector& PossibleActions); - - static bool Click(Internal::GameObject G, Button Button = BUTTON_LEFT); - static bool Click(Internal::GameObject G, const std::string& Action); - static bool Click(Internal::GameObject G, const std::vector& PossibleActions); - - static bool Click(Internal::GroundObject G, Button Button = BUTTON_LEFT); - static bool Click(Internal::GroundObject G, const std::string& Action); - static bool Click(Internal::GroundObject G, const std::vector& PossibleActions); - - static bool Click(Internal::WallObject W, Button Button = BUTTON_LEFT); - static bool Click(Internal::WallObject W, const std::string& Action); - static bool Click(Internal::WallObject W, const std::vector& PossibleActions); + static bool Scroll(const ScrollDirection& Direction); + static bool ScrollUntil(const ScrollDirection& Direction, std::int32_t Duration, const std::function& Func); static bool UpKey(std::int32_t Key); static bool DownKey(std::int32_t Key); - bool ReleaseKey(std::int32_t Key); bool HoldKey(std::int32_t Key, std::uint32_t Duration); - static bool TypeKey(std::int32_t Key); static bool TypeString(const std::string& String, bool PressEnter = false); }; diff --git a/Include/Game/Tools/Settings.hpp b/Include/Game/Tools/Settings.hpp index 175a40c..4a6492e 100644 --- a/Include/Game/Tools/Settings.hpp +++ b/Include/Game/Tools/Settings.hpp @@ -14,7 +14,11 @@ class Settings static std::int32_t GetSetting(std::int32_t SettingIndex); static std::int32_t GetSetting(std::int32_t SettingIndex, std::int32_t BitMask); static bool GetSettingBit(std::int32_t SettingIndex, std::int32_t BitIndex); + static std::int32_t GetScreenType(); + + static bool IsEscToCloseInterfacesOn(); + static bool IsShiftClickToDropOn(); }; /** @} */ diff --git a/Include/Game/Tools/Widgets.hpp b/Include/Game/Tools/Widgets.hpp index ce18013..b5c1256 100644 --- a/Include/Game/Tools/Widgets.hpp +++ b/Include/Game/Tools/Widgets.hpp @@ -1,8 +1,7 @@ #ifndef WIDGETS_HPP_INCLUDED #define WIDGETS_HPP_INCLUDED -#include "../../Core/Types/Box.hpp" -#include "../../Core/Classes/Widget.hpp" +#include "../../Game/Interactable/Widget.hpp" #include #include #include @@ -12,74 +11,14 @@ class Widgets { public: - /** - * @brief Returns true if the Widget, or it's Parent, is Hidden - * @code - * Widget Inventory = Widgets::GetWidget(149, 0); - * bool InventoryHidden = Widgets::IsHidden(Inventory); - * @endcode - */ - static bool IsHidden(const Internal::Widget& W); - /** - * @brief Returns the Box of the passed Widget - * @code - * Widget BankInventory = Widgets::GetWidget(15, 3); - * Box BankInventoryBox = Widgets::GetBox(BankInventory); - * @endcode - */ - static Box GetBox(const Internal::Widget& W); - /** - * @brief Returns the absolute X of the passed Widget - * @code - * Widget BankInventory = Widgets::GetWidget(15, 3); - * std::int32_t BankInventoryX = Widgets::GetX(BankInventory); - * @endcode - */ - static std::int32_t GetX(const Internal::Widget& W); - /** - * @brief Returns the absolute Y of the passed Widget - * @code - * Widget BankInventory = Widgets::GetWidget(15, 3); - * std::int32_t BankInventoryY = Widgets::GetX(BankInventory); - * @endcode - */ - static std::int32_t GetY(const Internal::Widget& W); - /** - * @brief (Temp) Returns the ItemIDs of the passed Widget - * @note Temporary function, this should be used over Widget.GetItemIDs() - */ - static std::vector GetItemIDs(const Internal::Widget& W); - - /** - * @brief Returns a vector of All Loaded Widgets - * @code std::vector> Widgets = Widgets::GetAll(); @endcode - */ - static std::vector> GetAll(); - /** - * @brief Returns the specified Widget by Parent ID - * @code std::vector BankParent = Widgets::Get(15); @endcode - */ - static std::vector GetAll(std::int32_t Parent); - /** - * @brief Returns the specified Widget by Parent, and Child ID - * @code Widget BankInventory = Widgets::Get(15, 3); @endcode - */ - static Internal::Widget Get(std::int32_t Parent, std::int32_t Child = -1); - /** - * @brief Returns the specified Widget by Parent, and Child, and Grandchild ID - * @code Widget BankCloseButton = Widgets::Get(12, 3, 11); @endcode - */ - static Internal::Widget Get(std::int32_t Parent, std::int32_t Child, std::int32_t Grandchild); - /** - * @brief Returns a vector of all Widgets that pass the specified Filter @see LibraryFilterLambdas - * @code - * auto const WTextEquals = [](const Widget& W){ return W.GetText() == "Enter Amount"; }; - * std::vector Widgets = Widgets::Get(WTextEquals); @endcode - * Will return all Widgets whose Text equals Enter Amount - */ - static std::vector GetAll(const std::function& Filter); + static std::vector> GetAll(); + static std::vector GetAll(std::int32_t Parent); + static std::vector GetAll(const std::function& Filter); + static Interactable::Widget Get(std::int32_t Parent, std::int32_t Child = -1); + static Interactable::Widget Get(std::int32_t Parent, std::int32_t Child, std::int32_t Grandchild); + static Interactable::Widget Get(const std::function& Filter); }; /** @} */ diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index 636882e..4bb29ff 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ