1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-16 10:19:47 +02:00
vcmi/client/widgets/markets/CAltarArtifacts.h

53 lines
1.7 KiB
C++
Raw Normal View History

2023-11-05 02:01:23 +02:00
/*
2023-12-04 23:21:49 +02:00
* CAltarArtifacts.h, part of VCMI engine
2023-11-05 02:01:23 +02:00
*
* 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
2023-12-04 23:21:49 +02:00
#include "../CArtifactsOfHeroAltar.h"
#include "CTradeBase.h"
2023-11-05 02:01:23 +02:00
2023-12-04 23:21:49 +02:00
class CAltarArtifacts : public CExperienceAltar
2023-11-05 02:01:23 +02:00
{
public:
CAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
2024-01-16 21:54:00 +02:00
~CAltarArtifacts();
2023-11-05 02:01:23 +02:00
TExpType calcExpAltarForHero() override;
void makeDeal() override;
void sacrificeAll() override;
void sacrificeBackpack();
void setSelectedArtifact(const CArtifactInstance * art);
std::shared_ptr<CArtifactsOfHeroAltar> getAOHset() const;
2024-01-16 16:22:40 +02:00
ObjectInstanceID getObjId() const;
void updateSlots();
2023-11-05 02:01:23 +02:00
private:
2024-01-12 23:57:19 +02:00
ObjectInstanceID altarId;
const CArtifactSet * altarArtifacts;
2023-11-05 02:01:23 +02:00
std::shared_ptr<CArtPlace> selectedArt;
std::shared_ptr<CLabel> selectedCost;
std::shared_ptr<CButton> sacrificeBackpackButton;
2024-01-16 16:22:40 +02:00
std::shared_ptr<CArtifactsOfHeroAltar> heroArts;
std::map<const CArtifactInstance*, std::shared_ptr<CTradeableItem>> tradeSlotsMap;
2023-11-05 02:01:23 +02:00
const std::vector<Point> 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)
};
2024-01-16 16:22:40 +02:00
void onSlotClickPressed(const std::shared_ptr<CTradeableItem> & altarSlot, std::shared_ptr<CTradeableItem> & hCurSlot) override;
TExpType calcExpCost(const CArtifactInstance * art);
2023-11-05 02:01:23 +02:00
};