2024-02-03 13:26:24 +02:00
|
|
|
/*
|
|
|
|
* CMarketWindow.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 "CTradeWindow.h"
|
|
|
|
#include "CAltarWindow.h"
|
|
|
|
|
2024-02-03 22:59:05 +02:00
|
|
|
class CFreelancerGuild;
|
|
|
|
|
|
|
|
class CMarketWindow : public CStatusbarWindow, public CAltarWindow // TODO remove CAltarWindow
|
2024-02-03 13:26:24 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMarketWindow(const IMarket * market, const CGHeroInstance * hero, const std::function<void()> & onWindowClosed, EMarketMode mode);
|
|
|
|
void resourceChanged();
|
|
|
|
void artifactsChanged();
|
2024-02-03 22:59:05 +02:00
|
|
|
void updateGarrisons() override;
|
2024-02-03 13:26:24 +02:00
|
|
|
void close() override;
|
|
|
|
const CGHeroInstance * getHero() const;
|
|
|
|
|
|
|
|
private:
|
2024-02-03 22:59:05 +02:00
|
|
|
void createChangeModeButtons(EMarketMode currentMode, const IMarket * market, const CGHeroInstance * hero);
|
2024-02-03 13:26:24 +02:00
|
|
|
void createInternals(EMarketMode mode, const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
|
|
|
|
void createArtifactsBuying(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createArtifactsSelling(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createMarketResources(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createFreelancersGuild(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createTransferResources(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createAltarCreatures(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
|
|
|
|
const int buttonHeightWithMargin = 32 + 3;
|
|
|
|
const CGHeroInstance * hero;
|
|
|
|
std::vector<std::shared_ptr<CButton>> changeModeButtons;
|
|
|
|
std::shared_ptr<CButton> quitButton;
|
|
|
|
std::function<void()> windowClosedCallback;
|
|
|
|
const Point quitButtonPos = Point(516, 520);
|
|
|
|
|
|
|
|
std::shared_ptr<CMarketplaceWindow> market;
|
2024-02-03 22:59:05 +02:00
|
|
|
std::shared_ptr<CFreelancerGuild> guild;
|
|
|
|
};
|