/* * CAltar.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/CArtifactsOfHeroAltar.h" #include "../widgets/CTradeBase.h" class CAltarArtifacts : public CExpAltar { public: CAltarArtifacts(const IMarket * market, const CGHeroInstance * hero); TExpType calcExpAltarForHero() override; void makeDeal() override; void sacrificeAll() override; void sacrificeBackpack(); void setSelectedArtifact(const CArtifactInstance * art); void moveArtToAltar(std::shared_ptr, const CArtifactInstance * art); std::shared_ptr getAOHset() const; private: std::shared_ptr selectedArt; std::shared_ptr selectedCost; std::shared_ptr sacrificeBackpackButton; std::shared_ptr arts; const std::vector posSlotsAltar = { Point(317, 53), Point(371, 53), Point(425, 53), Point(479, 53), Point(533, 53), Point(317, 123), Point(371, 123), Point(425, 123), Point(479, 123), Point(533, 123), Point(317, 193), Point(371, 193), Point(425, 193), Point(479, 193), Point(533, 193), Point(317, 263), Point(371, 263), Point(425, 263), Point(479, 263), Point(533, 263), Point(398, 333), Point(452, 333) }; bool putArtOnAltar(std::shared_ptr altarSlot, const CArtifactInstance * art); void onSlotClickPressed(std::shared_ptr altarSlot); }; class CAltarCreatures : public CExpAltar, public CCreaturesSelling { public: CAltarCreatures(const IMarket * market, const CGHeroInstance * hero); void updateSlots(); void deselect() override; TExpType calcExpAltarForHero() override; void makeDeal() override; void sacrificeAll() override; void updateAltarSlot(std::shared_ptr slot); private: std::shared_ptr maxUnits; std::vector unitsOnAltar; std::vector expPerUnit; std::shared_ptr lSubtitle, rSubtitle; void readExpValues(); void updateControls(); void updateSubtitlesForSelected(); void onOfferSliderMoved(int newVal); void onSlotClickPressed(std::shared_ptr & newSlot, std::shared_ptr & hCurSide) override; };