diff --git a/Include/Core/Classes/IndexableData.hpp b/Include/Core/Classes/IndexableData.hpp new file mode 100644 index 0000000..9a41c60 --- /dev/null +++ b/Include/Core/Classes/IndexableData.hpp @@ -0,0 +1,23 @@ +#ifndef INDEXABLEDATA_HPP_INCLUDED +#define INDEXABLEDATA_HPP_INCLUDED + +#include "../JavaClass/Object.hpp" +#include "../JavaClass/Class.hpp" +#include + +namespace Internal +{ + class IndexableData : public Object + { + public: + IndexableData(); + IndexableData(const void* Obj); + IndexableData(const IndexableData& IndexableData); + static Class GetClass(); + + std::vector> GetChildren() const; + + }; +} + +#endif // INDEXABLEDATA_HPP_INCLUDED diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index b70bebb..8577d05 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -53,6 +53,7 @@ #include "Classes/HashTable.hpp" #include "Classes/Ignore.hpp" #include "Classes/IgnoreList.hpp" +#include "Classes/IndexableData.hpp" #include "Classes/ItemContainer.hpp" #include "Classes/ItemInfo.hpp" #include "Classes/LinkedList.hpp" @@ -113,6 +114,7 @@ namespace Internal Deque GetGraphicsObjects(); std::vector>> GetGroundItems(); HashTable GetItemContainers(); + IndexableData GetItemIndexableData(); Cache GetItemInfoCache(); Cache GetItemModelCache(); std::int32_t GetItemSelected(); @@ -144,9 +146,11 @@ namespace Internal std::int32_t GetMouseX(); std::int32_t GetMouseY(); AttackOption GetNPCAttackOption(); + IndexableData GetNPCIndexableData(); std::vector GetNPCIndices(); Cache GetNPCModelCache(); std::vector GetNPCs(); + IndexableData GetObjectIndexableData(); Cache GetObjectInfoCache(); std::string GetPassword(); AttackOption GetPlayerAttackOption(); @@ -225,9 +229,9 @@ namespace Internal Sprite GetItemSprite(std::int32_t ID, std::int32_t Amount, std::int32_t BorderThickness, std::int32_t ShadowColor, std::int32_t StackType); Convex GetItemSpriteConvex(const Sprite& S); - std::int32_t GetSettings(std::int32_t ID); std::int32_t GetVarbitSettings(std::int32_t VarbitSettingIndex); Point TileToMainscreen(const Tile& T, std::int32_t X, std::int32_t Y, std::int32_t Z); + std::string GetItemName(std::int32_t ID); } #endif // INTERNAL_HPP_INCLUDED diff --git a/Include/Core/JavaClass/Object.hpp b/Include/Core/JavaClass/Object.hpp index 05a324d..b12ea80 100644 --- a/Include/Core/JavaClass/Object.hpp +++ b/Include/Core/JavaClass/Object.hpp @@ -10,6 +10,7 @@ class Object Object(); Object(const void* Obj); Object(const Object& O); + Object(Object&& O); Object& operator=(const Object& O); bool operator==(const Object& O) const; bool operator!=(const Object& O) const; diff --git a/Include/Game/Core.hpp b/Include/Game/Core.hpp index df33983..1eda31b 100644 --- a/Include/Game/Core.hpp +++ b/Include/Game/Core.hpp @@ -32,11 +32,13 @@ #include "Interfaces/GameTabs/Quests.hpp" #include "Interfaces/GameTabs/Stats.hpp" -#include "Models/SceneObjects.hpp" +#include "Models/DecorativeObjects.hpp" +#include "Models/GameObjects.hpp" #include "Models/GroundItems.hpp" +#include "Models/GroundObjects.hpp" #include "Models/NPCs.hpp" #include "Models/Players.hpp" -#include "Models/GameObjects.hpp" +#include "Models/WallObjects.hpp" #include "Interactable/GameObject.hpp" diff --git a/Include/Game/Interfaces/Login.hpp b/Include/Game/Interfaces/Login.hpp index a83dcbb..b351ddf 100644 --- a/Include/Game/Interfaces/Login.hpp +++ b/Include/Game/Interfaces/Login.hpp @@ -14,7 +14,7 @@ class Login { public: - typedef enum LOGIN_STATE + typedef enum LOGIN_SCREEN_STATE { WELCOME_SCREEN, ENTER_CREDENTIALS, @@ -30,9 +30,9 @@ class Login LOADING, LOBBY_SCREEN, LOGGED_IN - } LOGIN_STATE; + } LOGIN_SCREEN_STATE; - static LOGIN_STATE GetState(); + static LOGIN_SCREEN_STATE GetLoginScreenState(); static bool IsWorldSelectOpen(); static bool CloseWorldSelect(); diff --git a/Include/Game/Models/DecorativeObjects.hpp b/Include/Game/Models/DecorativeObjects.hpp new file mode 100644 index 0000000..bc010e3 --- /dev/null +++ b/Include/Game/Models/DecorativeObjects.hpp @@ -0,0 +1,42 @@ +#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 +#include +#include +#include + +/** @addtogroup Models +* @{ */ +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); + + //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); +}; + +/** @} */ + +#endif // DECORATIVEOBJECTS_HPP_INCLUDED diff --git a/Include/Game/Models/GameObjects.hpp b/Include/Game/Models/GameObjects.hpp index 66d3e80..b0a0d66 100644 --- a/Include/Game/Models/GameObjects.hpp +++ b/Include/Game/Models/GameObjects.hpp @@ -10,6 +10,8 @@ #include #include +/** @addtogroup Models +* @{ */ class GameObjects { public: @@ -20,21 +22,22 @@ class GameObjects static Convex GetConvexOf(const Internal::GameObject& G); //consider changing to Interactable::GameObject - 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 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 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); }; +/** @} */ + #endif // GAMEOBJECTS_HPP_INCLUDED diff --git a/Include/Game/Models/GroundObjects.hpp b/Include/Game/Models/GroundObjects.hpp new file mode 100644 index 0000000..b4b385c --- /dev/null +++ b/Include/Game/Models/GroundObjects.hpp @@ -0,0 +1,42 @@ +#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 +#include +#include +#include + +/** @addtogroup Models +* @{ */ +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); + + //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); +}; + +/** @} */ + +#endif // GROUNDOBJECTS_HPP_INCLUDED diff --git a/Include/Game/Models/SceneObjects.hpp b/Include/Game/Models/SceneObjects.hpp deleted file mode 100644 index c945c9b..0000000 --- a/Include/Game/Models/SceneObjects.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef SCENEOBJECTS_HPP_INCLUDED -#define SCENEOBJECTS_HPP_INCLUDED - -#include "../../Core/Classes/GameObject.hpp" -#include "../../Core/Classes/DecorativeObject.hpp" -#include "../../Core/Classes/GroundObject.hpp" -#include "../../Core/Classes/WallObject.hpp" -#include "../../Core/Classes/ObjectInfo.hpp" -#include "../../Core/Types/Tile.hpp" -#include "../../Core/Types/Convex.hpp" -#include -#include -#include -#include - -/** @addtogroup Models -* @{ */ -class SceneObjects -{ - public: - - typedef enum OBJECT_TYPE - { - GAME_OBJECT = (1 << 1), - DECORATIVE_OBJECT = (1 << 2), - GROUND_OBJECT = (1 << 3), - WALL_OBJECT = (1 << 4), - ALL = (GAME_OBJECT | DECORATIVE_OBJECT | GROUND_OBJECT | WALL_OBJECT) - } OBJECT_TYPE; - - static std::vector GetAll(OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(const Tile& T, OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(std::int32_t ID, OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(const std::string& Name, OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(const std::vector& PossibleIDs, OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(const std::vector& PossibleNames, OBJECT_TYPE ObjectTypes = ALL); - static std::vector GetAll(const std::function& Filter, OBJECT_TYPE ObjectTypes = ALL); - - static Object Get(const Tile& T, OBJECT_TYPE ObjectTypes = ALL); - static Object Get(std::int32_t ID, OBJECT_TYPE ObjectTypes = ALL); - static Object Get(const std::string& Name, OBJECT_TYPE ObjectTypes = ALL); - static Object Get(const std::vector& PossibleIDs, OBJECT_TYPE ObjectTypes = ALL); - static Object Get(const std::vector& PossibleNames, OBJECT_TYPE ObjectTypes = ALL); - static Object Get(const std::function& Filter, OBJECT_TYPE ObjectTypes = ALL); - - static Internal::ObjectInfo GetInfoOf(const Object& O); - static Internal::ObjectInfo GetInfoOf(const Internal::GameObject& G); - static Internal::ObjectInfo GetInfoOf(const Internal::DecorativeObject& D); - static Internal::ObjectInfo GetInfoOf(const Internal::GroundObject& G); - static Internal::ObjectInfo GetInfoOf(const Internal::WallObject& W); - - static Tile GetTileOf(const Object& O); - static Tile GetTileOf(const Internal::GameObject& G); - static Tile GetTileOf(const Internal::DecorativeObject& D); - static Tile GetTileOf(const Internal::GroundObject& G); - static Tile GetTileOf(const Internal::WallObject& W); - - static Convex GetConvexOf(const Object& O); - static Convex GetConvexOf(const Internal::GameObject& G); - static Convex GetConvexOf(const Internal::DecorativeObject& D); - static Convex GetConvexOf(const Internal::GroundObject& G); - static Convex GetConvexOf(const Internal::WallObject& W); -}; - -/** @} */ - -#endif // SCENEOBJECTS_HPP_INCLUDED diff --git a/Include/Game/Models/WallObjects.hpp b/Include/Game/Models/WallObjects.hpp new file mode 100644 index 0000000..9445d36 --- /dev/null +++ b/Include/Game/Models/WallObjects.hpp @@ -0,0 +1,42 @@ +#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 +#include +#include +#include + +/** @addtogroup Models +* @{ */ +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); + + //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); +}; + +/** @} */ + +#endif // WALLOBJECTS_HPP_INCLUDED diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index aa4142e..bd18e30 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ