2024-09-04 16:32:36 +02:00
|
|
|
/*
|
|
|
|
* VisitQueries.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"
|
|
|
|
|
|
|
|
//Created when hero visits object.
|
|
|
|
//Removed when query above is resolved (or immediately after visit if no queries were created)
|
2024-09-04 16:54:09 +02:00
|
|
|
class VisitQuery : public CQuery
|
2024-09-04 16:32:36 +02:00
|
|
|
{
|
2024-09-04 16:54:09 +02:00
|
|
|
protected:
|
|
|
|
VisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero);
|
|
|
|
|
2024-09-04 16:32:36 +02:00
|
|
|
public:
|
|
|
|
const CGObjectInstance *visitedObject;
|
|
|
|
const CGHeroInstance *visitingHero;
|
|
|
|
|
2024-09-04 16:54:09 +02:00
|
|
|
bool blocksPack(const CPack *pack) const final;
|
|
|
|
void onExposure(QueryPtr topQuery) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MapObjectVisitQuery final : public VisitQuery
|
|
|
|
{
|
|
|
|
public:
|
2024-09-04 16:32:36 +02:00
|
|
|
bool removeObjectAfterVisit;
|
|
|
|
|
2024-09-04 16:54:09 +02:00
|
|
|
MapObjectVisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero);
|
|
|
|
|
|
|
|
void onRemoval(PlayerColor color) final;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TownBuildingVisitQuery final : public VisitQuery
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BuildingID visitedBuilding;
|
|
|
|
|
|
|
|
TownBuildingVisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero, BuildingID buildingToVisit);
|
2024-09-04 16:32:36 +02:00
|
|
|
|
2024-09-04 16:54:09 +02:00
|
|
|
void onRemoval(PlayerColor color) final;
|
2024-09-04 16:32:36 +02:00
|
|
|
};
|