CAltarWindow.h 1.3 KB

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