entitiesselector.h 979 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * entitiesselector.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 <QWidget>
  12. #include "../StdInc.h"
  13. #include "../../lib/constants/EntityIdentifiers.h"
  14. namespace Ui {
  15. class EntitiesSelector;
  16. }
  17. using EntityIds = std::variant<std::reference_wrapper<std::set<TerrainId>>, std::reference_wrapper<std::set<SpellID>>, std::reference_wrapper<std::set<ArtifactID>>, std::reference_wrapper<std::set<SecondarySkill>>, std::reference_wrapper<std::set<HeroTypeID>>>;
  18. class EntitiesSelector : public QDialog
  19. {
  20. Q_OBJECT
  21. public:
  22. explicit EntitiesSelector(EntityIds & entities);
  23. static void showEntitiesSelector(EntityIds & entities);
  24. private slots:
  25. void on_buttonBoxResult_accepted();
  26. void on_buttonBoxResult_rejected();
  27. private:
  28. Ui::EntitiesSelector *ui;
  29. EntityIds & entitiesSelected;
  30. };