QuickRecruitmentWindow.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * QuickRecruitmentWindow.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../windows/CWindowObject.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class CGTownInstance;
  14. VCMI_LIB_NAMESPACE_END
  15. class CButton;
  16. class CreatureCostBox;
  17. class CreaturePurchaseCard;
  18. class CFilledTexture;
  19. class QuickRecruitmentWindow : public CWindowObject
  20. {
  21. public:
  22. int getAvailableCreatures();
  23. void updateAllSliders();
  24. QuickRecruitmentWindow(const CGTownInstance * townd, Rect startupPosition);
  25. private:
  26. void initWindow(Rect startupPosition);
  27. void setButtons();
  28. void setCancelButton();
  29. void setBuyButton();
  30. void setMaxButton();
  31. void setCreaturePurchaseCards();
  32. void maxAllCards(std::vector<std::shared_ptr<CreaturePurchaseCard>> cards);
  33. void maxAllSlidersAmount(std::vector<std::shared_ptr<CreaturePurchaseCard>> cards);
  34. void purchaseUnits();
  35. const CGTownInstance * town;
  36. std::shared_ptr<CButton> maxButton;
  37. std::shared_ptr<CButton> buyButton;
  38. std::shared_ptr<CButton> cancelButton;
  39. std::shared_ptr<CreatureCostBox> totalCost;
  40. std::vector<std::shared_ptr<CreaturePurchaseCard>> cards;
  41. std::shared_ptr<CFilledTexture> backgroundTexture;
  42. std::shared_ptr<CPicture> costBackground;
  43. };