62 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
| #ifndef INTERACTABLEITEM_CPP_INCLUDED
 | |
| #define INTERACTABLEITEM_CPP_INCLUDED
 | |
| 
 | |
| #include "../../Core/Classes/ItemInfo.hpp"
 | |
| #include "../../Core/Classes/Sprite.hpp"
 | |
| #include "../../Core/Types/Point.hpp"
 | |
| #include "../../Core/Types/Box.hpp"
 | |
| #include "../../Core/Types/Convex.hpp"
 | |
| #include "../../Core/Input.hpp"
 | |
| #include <cstdint>
 | |
| 
 | |
| namespace Interactable
 | |
| {
 | |
|     class Item
 | |
|     {
 | |
|         public:
 | |
|             typedef enum ITEM_SOURCE
 | |
|             {
 | |
|                 INVENTORY,
 | |
|                 EQUIPMENT,
 | |
|                 BANK
 | |
|             } ITEM_SOURCE;
 | |
| 
 | |
|             Item();
 | |
|             Item(std::int32_t Index, std::int32_t ID, ITEM_SOURCE Source);
 | |
|             Item(const Interactable::Item& Item);
 | |
| 
 | |
|             bool Exists() const;
 | |
|             static bool ItemsExist(const std::vector<Interactable::Item>& Items);
 | |
|             bool IsInterfaceOpen() const;
 | |
| 
 | |
|             std::int32_t GetID() const;
 | |
|             std::int32_t GetIndex() const;
 | |
|             ITEM_SOURCE GetSource() const;
 | |
|             std::string GetName() const;
 | |
|             std::int32_t GetStackAmount() const;
 | |
|             Internal::ItemInfo GetInfo() const;
 | |
| 
 | |
|             Internal::Sprite GetSprite() const;
 | |
|             Convex GetConvex() const;
 | |
|             Box GetBox() const;
 | |
|             Point GetPoint() const;
 | |
|             Point GetPoint(double PointGenAccuracy) const;
 | |
| 
 | |
|             bool Hover() const;
 | |
|             bool Interact(const Button& B = BUTTON_LEFT) const;
 | |
|             bool Interact(const std::string& Option, bool CheckTarget = false) const;
 | |
|             bool Interact(const std::vector<std::string>& Options, bool CheckTarget = false) const;
 | |
| 
 | |
|             bool Valid() const;
 | |
|             operator bool() const;
 | |
| 
 | |
|             virtual ~Item();
 | |
|         private:
 | |
|             std::int32_t Index;
 | |
|             std::int32_t ID;
 | |
|             ITEM_SOURCE Source;
 | |
|     };
 | |
| }
 | |
| 
 | |
| #endif // INTERACTABLEITEM_CPP_INCLUDED
 |