CAltarWindow.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * CAltarWindow.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 "../widgets/markets/CAltarArtifacts.h"
  12. #include "../widgets/markets/CAltarCreatures.h"
  13. #include "../widgets/CWindowWithArtifacts.h"
  14. #include "CWindowObject.h"
  15. class CAltarWindow : public CWindowObject, public CWindowWithArtifacts, public IGarrisonHolder
  16. {
  17. public:
  18. CAltarWindow(const IMarket * market, const CGHeroInstance * hero, const std::function<void()> & onWindowClosed, EMarketMode mode);
  19. void updateExpToLevel();
  20. void updateGarrisons() override;
  21. bool holdsGarrison(const CArmedInstance * army) override;
  22. const CGHeroInstance * getHero() const;
  23. void close() override;
  24. void artifactMoved(const ArtifactLocation & srcLoc, const ArtifactLocation & destLoc, bool withRedraw) override;
  25. void showAll(Canvas & to) override;
  26. private:
  27. const CGHeroInstance * hero;
  28. std::shared_ptr<CExperienceAltar> altar;
  29. std::shared_ptr<CButton> changeModeButton;
  30. std::shared_ptr<CButton> quitButton;
  31. std::function<void()> windowClosedCallback;
  32. std::shared_ptr<CGStatusBar> statusBar;
  33. void createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
  34. void createAltarCreatures(const IMarket * market, const CGHeroInstance * hero);
  35. };