BattleQueries.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * BattleQueries.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 "CQuery.h"
  12. #include "../../lib/networkPacks/PacksForClientBattle.h"
  13. #include "../../lib/battle/BattleSide.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. class IBattleInfo;
  16. struct SideInBattle;
  17. VCMI_LIB_NAMESPACE_END
  18. class CBattleQuery : public CQuery
  19. {
  20. public:
  21. BattleSideArray<const CArmedInstance *> belligerents;
  22. BattleID battleID;
  23. std::optional<BattleResult> result;
  24. CBattleQuery(CGameHandler * owner);
  25. CBattleQuery(CGameHandler * owner, const IBattleInfo * Bi);
  26. void notifyObjectAboutRemoval(const CGObjectInstance * visitedObject, const CGHeroInstance * visitingHero) const override;
  27. bool blocksPack(const CPackForServer *pack) const override;
  28. void onRemoval(PlayerColor color) override;
  29. void onExposure(QueryPtr topQuery) override;
  30. };
  31. class CBattleDialogQuery : public CDialogQuery
  32. {
  33. bool resultProcessed = false;
  34. const IBattleInfo * bi;
  35. std::optional<BattleResult> result;
  36. public:
  37. CBattleDialogQuery(CGameHandler * owner, const IBattleInfo * Bi, const std::optional<BattleResult> & Br);
  38. void onRemoval(PlayerColor color) override;
  39. };