AlpacaLibrary/Include/Game/Interfaces/Exchange.hpp

117 lines
3.5 KiB
C++
Raw Permalink Normal View History

2018-07-20 09:50:38 +00:00
#ifndef EXCHANGE_HPP_INCLUDED
#define EXCHANGE_HPP_INCLUDED
2018-07-22 10:12:31 +00:00
#include "../../Core/Classes/ExchangeOffer.hpp"
2018-07-20 09:50:38 +00:00
#include <cstdint>
#include <string>
#include <vector>
2018-07-22 10:12:31 +00:00
#include <functional>
2024-04-16 08:38:19 +00:00
#include <regex>
2018-07-20 09:50:38 +00:00
2018-12-27 18:17:09 +00:00
namespace Exchange
2018-07-20 09:50:38 +00:00
{
2018-12-27 18:17:09 +00:00
typedef std::int32_t SLOT;
typedef enum SLOT_STATE
{
STATE_EMPTY = 0,
STARTING_BUY_OFFER = 1,
BUY_OFFER_INCOMPLETE = 2,
BUY_OFFER_UPDATING = 3,
BUY_OFFER_CANCELING = 4,
BUY_OFFER_COMPLETE = 5,
STARTING_SELL_OFFER = 9,
SELL_OFFER_INCOMPLETE = 10,
SELL_OFFER_UPDATING = 11,
SELL_OFFER_CANCELING = 12,
SELL_OFFER_COMPLETE = 13,
STATE_DISABLED = 14,
STATE_UNDEFINED = 15
} SLOT_STATE;
typedef enum SLOT_MODE
{
BUY = 0,
SELL = 1,
MODE_DISABLED = 2,
MODE_UNDEFINED = 3
} SLOT_MODE;
typedef enum COLLECT_METHOD
{
ITEM,
NOTE,
BANK
} COLLECT_METHOD;
bool IsOpen();
bool Open();
bool Close();
SLOT_STATE GetSlotState(const Exchange::SLOT Slot);
bool SlotOccupied(const Exchange::SLOT Slot);
std::vector<SLOT_STATE> GetAllSlotStates();
bool AllSlotsOccupied();
std::int32_t GetOfferIndex();
SLOT_MODE GetOfferMode();
std::int32_t GetOfferItemID();
std::string GetOfferItemName();
std::int32_t GetOfferAmount();
std::int32_t GetOfferPrice();
bool IsOfferOpen();
bool CloseOffer();
bool IsOffersOpen();
bool SlotUsable(const Exchange::SLOT Slot);
bool CanCollect();
bool CollectAll(const bool Inventory = true);
bool Collect(const Exchange::COLLECT_METHOD Method = Exchange::BANK);
bool IsBuyOfferOpen();
bool IsSellOfferOpen();
bool OpenBuyOffer(const Exchange::SLOT Slot = -1);
bool OpenSellOffer(const Exchange::SLOT Slot = -1);
Exchange::SLOT GetBuyOffer(std::int32_t ID);
Exchange::SLOT GetBuyOffer(const std::string& Name);
Exchange::SLOT GetBuyOffer(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
std::vector<Exchange::SLOT> GetBuyOffers(std::int32_t ID);
std::vector<Exchange::SLOT> GetBuyOffers(const std::string& Name);
std::vector<Exchange::SLOT> GetBuyOffers(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
Exchange::SLOT GetSellOffer(std::int32_t ID);
Exchange::SLOT GetSellOffer(const std::string& Name);
Exchange::SLOT GetSellOffer(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
std::vector<Exchange::SLOT> GetSellOffers(std::int32_t ID);
std::vector<Exchange::SLOT> GetSellOffers(const std::string& Name);
std::vector<Exchange::SLOT> GetSellOffers(const std::function<bool (const Internal::ExchangeOffer&)>& Filter);
2023-09-20 22:16:17 +00:00
bool SetSellItem(const std::string& Name, std::int32_t ID = -1);
2024-04-16 08:38:19 +00:00
bool SetSellItem(const std::regex& Name, std::int32_t ID = -1);
2018-12-27 18:17:09 +00:00
bool SetSellItem(std::int32_t ID);
2023-09-20 22:16:17 +00:00
bool SetBuyItem(const std::string& Name, std::int32_t ID = -1);
2018-12-27 18:17:09 +00:00
bool SetOfferAmount(std::uint32_t Amount);
bool SetOfferPrice(std::uint32_t Price);
2023-09-20 22:16:17 +00:00
std::int32_t GetGuidePrice();
2018-12-27 18:17:09 +00:00
bool SetOfferGuidePrice();
bool ConfirmOffer();
typedef enum COLLECT_SLOT
{
ONE,
TWO
} COLLECT_SLOT;
std::string GetCollectSlotName(Exchange::COLLECT_SLOT Slot);
std::int32_t GetCollectSlotID(Exchange::COLLECT_SLOT Slot);
std::int32_t GetCollectSlotAmount(Exchange::COLLECT_SLOT Slot);
bool AbortOffer(const Exchange::SLOT Slot = -1);
bool OpenOffer(const Exchange::SLOT Slot);
2018-12-31 21:52:58 +00:00
}
2018-07-20 09:50:38 +00:00
#endif // EXCHANGE_HPP_INCLUDED