CMarketWindow.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * CMarketWindow.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 "CTradeWindow.h"
  12. #include "CAltarWindow.h"
  13. class CArtifactsBuying;
  14. class CFreelancerGuild;
  15. class CMarketResources;
  16. class CTransferResources;
  17. class CMarketWindow : public CStatusbarWindow, public CAltarWindow // TODO remove CAltarWindow
  18. {
  19. public:
  20. CMarketWindow(const IMarket * market, const CGHeroInstance * hero, const std::function<void()> & onWindowClosed, EMarketMode mode);
  21. void resourceChanged();
  22. void artifactsChanged();
  23. void updateGarrisons() override;
  24. void close() override;
  25. const CGHeroInstance * getHero() const;
  26. private:
  27. void createChangeModeButtons(EMarketMode currentMode, const IMarket * market, const CGHeroInstance * hero);
  28. void createInternals(EMarketMode mode, const IMarket * market, const CGHeroInstance * hero);
  29. void createArtifactsBuying(const IMarket * market, const CGHeroInstance * hero);
  30. void createArtifactsSelling(const IMarket * market, const CGHeroInstance * hero);
  31. void createMarketResources(const IMarket * market, const CGHeroInstance * hero);
  32. void createFreelancersGuild(const IMarket * market, const CGHeroInstance * hero);
  33. void createTransferResources(const IMarket * market, const CGHeroInstance * hero);
  34. void createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
  35. void createAltarCreatures(const IMarket * market, const CGHeroInstance * hero);
  36. const int buttonHeightWithMargin = 32 + 3;
  37. const CGHeroInstance * hero;
  38. std::vector<std::shared_ptr<CButton>> changeModeButtons;
  39. std::shared_ptr<CButton> quitButton;
  40. std::function<void()> windowClosedCallback;
  41. const Point quitButtonPos = Point(516, 520);
  42. std::shared_ptr<CMarketplaceWindow> market;
  43. std::shared_ptr<CFreelancerGuild> guild;
  44. std::shared_ptr<CMarketResources> resRes;
  45. std::shared_ptr<CTransferResources> trRes;
  46. std::shared_ptr<CArtifactsBuying> artsBuy;
  47. };