mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-16 10:19:47 +02:00
d34b4a141e
from building visit
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
/*
|
|
* 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)
|
|
class VisitQuery : public CQuery
|
|
{
|
|
protected:
|
|
VisitQuery(CGameHandler * owner, const CGObjectInstance *Obj, const CGHeroInstance *Hero);
|
|
|
|
public:
|
|
const CGObjectInstance *visitedObject;
|
|
const CGHeroInstance *visitingHero;
|
|
|
|
bool blocksPack(const CPack *pack) const final;
|
|
void onExposure(QueryPtr topQuery) final;
|
|
};
|
|
|
|
class MapObjectVisitQuery final : public VisitQuery
|
|
{
|
|
public:
|
|
bool removeObjectAfterVisit;
|
|
|
|
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);
|
|
|
|
void onRemoval(PlayerColor color) final;
|
|
};
|