CMarketWindow.h 2.1 KB

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