IMarket.h 937 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * IMarket.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../networkPacks/TradeItem.h"
  12. #include "../constants/Enumerations.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class CGObjectInstance;
  15. class DLL_LINKAGE IMarket
  16. {
  17. public:
  18. IMarket();
  19. virtual ~IMarket() {}
  20. virtual int getMarketEfficiency() const = 0;
  21. virtual bool allowsTrade(EMarketMode mode) const;
  22. virtual int availableUnits(EMarketMode mode, int marketItemSerial) const; //-1 if unlimited
  23. virtual std::vector<TradeItemBuy> availableItemsIds(EMarketMode mode) const;
  24. bool getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode) const; //val1 - how many units of id1 player has to give to receive val2 units
  25. std::vector<EMarketMode> availableModes() const;
  26. };
  27. VCMI_LIB_NAMESPACE_END