AlpacaLibary  1.63
A closed source C++ bot for OSRS
Exchange.hpp
Go to the documentation of this file.
1 #ifndef EXCHANGE_HPP_INCLUDED
2 #define EXCHANGE_HPP_INCLUDED
3 
4 #include "../../Core/Classes/ExchangeOffer.hpp"
5 #include <cstdint>
6 #include <string>
7 #include <vector>
8 #include <functional>
9 
10 namespace Exchange
11 {
12  typedef std::int32_t SLOT;
13 
14  typedef enum SLOT_STATE
15  {
28  STATE_UNDEFINED = 15
30 
31  typedef enum SLOT_MODE
32  {
33  BUY = 0,
34  SELL = 1,
36  MODE_UNDEFINED = 3
38 
39  typedef enum COLLECT_METHOD
40  {
43  BANK
45 
46  bool IsOpen();
47  bool Open();
48  bool Close();
50  bool SlotOccupied(const Exchange::SLOT Slot);
51  std::vector<SLOT_STATE> GetAllSlotStates();
53  std::int32_t GetOfferIndex();
54 
56  std::int32_t GetOfferItemID();
57  std::string GetOfferItemName();
58  std::int32_t GetOfferAmount();
59  std::int32_t GetOfferPrice();
60  bool IsOfferOpen();
61  bool CloseOffer();
62  bool IsOffersOpen();
63  bool SlotUsable(const Exchange::SLOT Slot);
64  bool CanCollect();
65 
66  bool CollectAll(const bool Inventory = true);
68 
71  bool OpenBuyOffer(const Exchange::SLOT Slot = -1);
72  bool OpenSellOffer(const Exchange::SLOT Slot = -1);
73 
74  Exchange::SLOT GetBuyOffer(std::int32_t ID);
75  Exchange::SLOT GetBuyOffer(const std::string& Name);
76  Exchange::SLOT GetBuyOffer(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
77  std::vector<Exchange::SLOT> GetBuyOffers(std::int32_t ID);
78  std::vector<Exchange::SLOT> GetBuyOffers(const std::string& Name);
79  std::vector<Exchange::SLOT> GetBuyOffers(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
80 
81  Exchange::SLOT GetSellOffer(std::int32_t ID);
82  Exchange::SLOT GetSellOffer(const std::string& Name);
83  Exchange::SLOT GetSellOffer(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
84  std::vector<Exchange::SLOT> GetSellOffers(std::int32_t ID);
85  std::vector<Exchange::SLOT> GetSellOffers(const std::string& Name);
86  std::vector<Exchange::SLOT> GetSellOffers(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
87 
88 
89  bool SetSellItem(const std::string& Name);
90  bool SetSellItem(std::int32_t ID);
91  bool SetBuyItem(const std::string& Name);
92  bool SetOfferAmount(std::uint32_t Amount);
93  bool SetOfferPrice(std::uint32_t Price);
95  bool ConfirmOffer();
96 
97 
98  typedef enum COLLECT_SLOT
99  {
101  TWO
103 
107 
108  bool AbortOffer(const Exchange::SLOT Slot = -1);
109 
110  bool OpenOffer(const Exchange::SLOT Slot);
111 }
112 
113 #endif // EXCHANGE_HPP_INCLUDED
std::string GetOfferItemName()
bool SlotOccupied(const Exchange::SLOT Slot)
std::vector< SLOT_STATE > GetAllSlotStates()
std::int32_t GetOfferAmount()
bool Close()
bool SetBuyItem(const std::string &Name)
bool CloseOffer()
bool OpenSellOffer(const Exchange::SLOT Slot=-1)
bool ConfirmOffer()
bool Open()
bool CollectAll(const bool Inventory=true)
std::int32_t GetCollectSlotAmount(Exchange::COLLECT_SLOT Slot)
bool IsOffersOpen()
bool AbortOffer(const Exchange::SLOT Slot=-1)
bool SetOfferGuidePrice()
bool SetOfferAmount(std::uint32_t Amount)
bool OpenOffer(const Exchange::SLOT Slot)
std::int32_t GetOfferItemID()
bool SetOfferPrice(std::uint32_t Price)
SLOT_STATE GetSlotState(const Exchange::SLOT Slot)
std::int32_t SLOT
Definition: Exchange.hpp:12
bool CanCollect()
std::int32_t GetCollectSlotID(Exchange::COLLECT_SLOT Slot)
@ MODE_UNDEFINED
Definition: Exchange.hpp:36
@ MODE_DISABLED
Definition: Exchange.hpp:35
bool IsSellOfferOpen()
COLLECT_METHOD
Definition: Exchange.hpp:40
Exchange::SLOT GetSellOffer(std::int32_t ID)
std::int32_t GetOfferIndex()
bool OpenBuyOffer(const Exchange::SLOT Slot=-1)
SLOT_MODE GetOfferMode()
std::vector< Exchange::SLOT > GetBuyOffers(std::int32_t ID)
bool SetSellItem(const std::string &Name)
bool Collect(const Exchange::COLLECT_METHOD Method=Exchange::BANK)
bool SlotUsable(const Exchange::SLOT Slot)
bool IsOfferOpen()
bool AllSlotsOccupied()
std::int32_t GetOfferPrice()
std::vector< Exchange::SLOT > GetSellOffers(std::int32_t ID)
std::string GetCollectSlotName(Exchange::COLLECT_SLOT Slot)
bool IsBuyOfferOpen()
bool IsOpen()
@ BUY_OFFER_CANCELING
Definition: Exchange.hpp:20
@ STARTING_SELL_OFFER
Definition: Exchange.hpp:22
@ BUY_OFFER_COMPLETE
Definition: Exchange.hpp:21
@ SELL_OFFER_INCOMPLETE
Definition: Exchange.hpp:23
@ STATE_EMPTY
Definition: Exchange.hpp:16
@ BUY_OFFER_UPDATING
Definition: Exchange.hpp:19
@ STARTING_BUY_OFFER
Definition: Exchange.hpp:17
@ SELL_OFFER_COMPLETE
Definition: Exchange.hpp:26
@ STATE_UNDEFINED
Definition: Exchange.hpp:28
@ BUY_OFFER_INCOMPLETE
Definition: Exchange.hpp:18
@ SELL_OFFER_UPDATING
Definition: Exchange.hpp:24
@ STATE_DISABLED
Definition: Exchange.hpp:27
@ SELL_OFFER_CANCELING
Definition: Exchange.hpp:25
Exchange::SLOT GetBuyOffer(std::int32_t ID)