/* * StackQueue.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 "../gui/CIntObject.h" VCMI_LIB_NAMESPACE_BEGIN namespace battle { class Unit; } VCMI_LIB_NAMESPACE_END class CLabel; class TransparentFilledRectangle; class CAnimImage; class CFilledTexture; class BattleInterface; /// Shows the stack queue class StackQueue : public CIntObject { class StackBox : public CIntObject { StackQueue * owner; std::optional boundUnitID; std::shared_ptr background; std::shared_ptr icon; std::shared_ptr amount; std::shared_ptr waitIcon; std::shared_ptr defendIcon; std::shared_ptr round; std::shared_ptr roundRect; void show(Canvas & to) override; void showAll(Canvas & to) override; void showPopupWindow(const Point & cursorPosition) override; bool isBoundUnitHighlighted() const; public: StackBox(StackQueue * owner); void setUnit(const battle::Unit * unit, size_t turn = 0, std::optional currentTurn = std::nullopt); std::optional getBoundUnitID() const; }; static const int QUEUE_SIZE_BIG = 10; std::shared_ptr background; std::vector> stackBoxes; BattleInterface & owner; int32_t getSiegeShooterIconID() const; public: const bool embedded; StackQueue(bool Embedded, BattleInterface & owner); void update(); std::optional getHoveredUnitIdIfAny() const; void show(Canvas & to) override; };