2023-11-05 02:01:23 +02:00
|
|
|
/*
|
|
|
|
* CAltarWindow.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../widgets/CAltar.h"
|
|
|
|
#include "../widgets/CWindowWithArtifacts.h"
|
|
|
|
#include "CWindowObject.h"
|
|
|
|
|
2023-11-09 00:01:48 +02:00
|
|
|
class CAltarWindow : public CWindowObject, public CWindowWithArtifacts, public IGarrisonHolder
|
2023-11-05 02:01:23 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CAltarWindow(const IMarket * market, const CGHeroInstance * hero, const std::function<void()> & onWindowClosed, EMarketMode mode);
|
|
|
|
void updateExpToLevel();
|
2023-11-09 00:01:48 +02:00
|
|
|
void updateGarrisons() override;
|
|
|
|
bool holdsGarrison(const CArmedInstance * army) override;
|
2023-11-05 02:01:23 +02:00
|
|
|
const CGHeroInstance * getHero() const;
|
|
|
|
void close() override;
|
|
|
|
|
|
|
|
void artifactMoved(const ArtifactLocation & srcLoc, const ArtifactLocation & destLoc, bool withRedraw) override;
|
|
|
|
void showAll(Canvas & to) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const CGHeroInstance * hero;
|
|
|
|
std::shared_ptr<CAltar> altar;
|
|
|
|
std::shared_ptr<CButton> changeModeButton;
|
|
|
|
std::shared_ptr<CButton> quitButton;
|
|
|
|
std::function<void()> windowClosedCallback;
|
|
|
|
std::shared_ptr<CGStatusBar> statusBar;
|
|
|
|
|
|
|
|
void createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createAltarCreatures(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
};
|