1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/client/widgets/markets/CAltarArtifacts.h
Ivan Savenko 20d5b33ea6 Remove marketModes as member
marketModes are now generated in runtime and are not a member of
IMarket. Was not a bad change, but towns load buildings before town type
is randomized, leading to case where market modes are not actually known
when building is added to town (like random towns with market built)

Since altar requires CArtifactSet for work, IMarket will now always
contain it, but it will only be accessible if market supports altar
mode.
2024-08-27 14:07:00 +00:00

39 lines
1.2 KiB
C++

/*
* CAltarArtifacts.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 "../CArtifactsOfHeroAltar.h"
#include "CMarketBase.h"
class CAltarArtifacts : public CExperienceAltar
{
public:
CAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
TExpType calcExpAltarForHero() override;
void deselect() override;
void makeDeal() override;
void update() override;
void sacrificeAll() override;
void sacrificeBackpack();
std::shared_ptr<CArtifactsOfHeroAltar> getAOHset() const;
void putBackArtifacts();
private:
const CArtifactSet * altarArtifactsStorage;
std::shared_ptr<CButton> sacrificeBackpackButton;
std::shared_ptr<CArtifactsOfHeroAltar> heroArts;
std::map<std::shared_ptr<CTradeableItem>, const CArtifactInstance*> tradeSlotsMap;
void updateAltarSlots();
CMarketBase::MarketShowcasesParams getShowcasesParams() const override;
void onSlotClickPressed(const std::shared_ptr<CTradeableItem> & altarSlot, std::shared_ptr<TradePanelBase> & curPanel) override;
TExpType calcExpCost(ArtifactID id) const;
};