QueriesProcessor.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * QueriesProcessor.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 "../../lib/GameConstants.h"
  12. class CQuery;
  13. using QueryPtr = std::shared_ptr<CQuery>;
  14. class QueriesProcessor
  15. {
  16. private:
  17. void addQuery(PlayerColor player, QueryPtr query);
  18. void popQuery(PlayerColor player, QueryPtr query);
  19. std::map<PlayerColor, std::vector<QueryPtr>> queries; //player => stack of queries
  20. public:
  21. void addQuery(QueryPtr query);
  22. void popQuery(const CQuery &query);
  23. void popQuery(QueryPtr query);
  24. void popIfTop(const CQuery &query); //removes this query if it is at the top (otherwise, do nothing)
  25. void popIfTop(QueryPtr query); //removes this query if it is at the top (otherwise, do nothing)
  26. QueryPtr topQuery(PlayerColor player);
  27. std::vector<std::shared_ptr<const CQuery>> allQueries() const;
  28. std::vector<QueryPtr> allQueries();
  29. QueryPtr getQuery(QueryID queryID);
  30. //void removeQuery
  31. };