2023-07-23 23:46:29 +02:00
|
|
|
/*
|
|
|
|
* BattleQueries.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 "CQuery.h"
|
2023-10-23 12:59:15 +02:00
|
|
|
#include "../../lib/networkPacks/PacksForClientBattle.h"
|
2024-08-11 22:22:35 +02:00
|
|
|
#include "../../lib/battle/BattleSide.h"
|
2023-07-23 23:46:29 +02:00
|
|
|
|
2023-08-28 16:43:57 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
class IBattleInfo;
|
2024-01-26 00:44:41 +02:00
|
|
|
struct SideInBattle;
|
2023-08-28 16:43:57 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
2023-09-19 22:17:25 +02:00
|
|
|
class CBattleQuery : public CQuery
|
2023-07-23 23:46:29 +02:00
|
|
|
{
|
|
|
|
public:
|
2024-08-11 22:22:35 +02:00
|
|
|
BattleSideArray<const CArmedInstance *> belligerents;
|
|
|
|
BattleSideArray<int> initialHeroMana;
|
2023-07-23 23:46:29 +02:00
|
|
|
|
2023-08-31 17:45:52 +02:00
|
|
|
BattleID battleID;
|
2023-07-23 23:46:29 +02:00
|
|
|
std::optional<BattleResult> result;
|
|
|
|
|
|
|
|
CBattleQuery(CGameHandler * owner);
|
2023-08-28 16:43:57 +02:00
|
|
|
CBattleQuery(CGameHandler * owner, const IBattleInfo * Bi); //TODO
|
2024-03-04 21:34:43 +02:00
|
|
|
void notifyObjectAboutRemoval(const CObjectVisitQuery &objectVisit) const override;
|
2024-02-10 21:22:08 +02:00
|
|
|
bool blocksPack(const CPack *pack) const override;
|
|
|
|
void onRemoval(PlayerColor color) override;
|
|
|
|
void onExposure(QueryPtr topQuery) override;
|
2023-07-23 23:46:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CBattleDialogQuery : public CDialogQuery
|
|
|
|
{
|
2024-06-01 12:06:16 +02:00
|
|
|
bool resultProcessed = false;
|
2023-08-28 16:43:57 +02:00
|
|
|
const IBattleInfo * bi;
|
2024-02-28 23:25:14 +02:00
|
|
|
std::optional<BattleResult> result;
|
2024-07-15 09:46:40 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
CBattleDialogQuery(CGameHandler * owner, const IBattleInfo * Bi, std::optional<BattleResult> Br);
|
2024-02-10 21:22:08 +02:00
|
|
|
void onRemoval(PlayerColor color) override;
|
2023-07-23 23:46:29 +02:00
|
|
|
};
|