1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00
Files
vcmi/server/ServerSpellCastEnvironment.h
T
George King 1d0a6198ff [1.7.4] Add Reinforcements spell support (#7217)
* Reinforcements spell support

* Fix build

* Add forgotten change to allow moving creatures between hero and garrison

* Extract findNearestTown into TownRelatedSpellUtils

* Fix for exchange when exist garrisoned hero in destination town

* Improve handling when garrisoned hero exist in destination town

* Fix portrait position

* Update GUIClasses.cpp

* Fix flag position

* Update GUIClasses.cpp

* Update ReinforcementsEffect.cpp

* Rework to reflect latest advices

* Delete lib/spells/adventure/TownRelatedSpellUtils.cpp

* Delete lib/spells/adventure/TownRelatedSpellUtils.h

* Custom title text for Garrison dialog

* Add forgotten change

* ReRun CI
2026-04-19 12:10:24 +03:00

46 lines
1.5 KiB
C++

/*
* ServerSpellCastEnvironment.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 "../lib/spells/ISpellMechanics.h"
class CGameHandler;
class ServerSpellCastEnvironment : public SpellCastEnvironment
{
public:
ServerSpellCastEnvironment(CGameHandler * gh);
~ServerSpellCastEnvironment() = default;
void complain(const std::string & problem) override;
bool describeChanges() const override;
vstd::RNG * getRNG() override;
void apply(CPackForClient & pack) override;
void apply(BattleLogMessage & pack) override;
void apply(BattleStackMoved & pack) override;
void apply(BattleUnitsChanged & pack) override;
void apply(SetStackEffect & pack) override;
void apply(StacksInjured & pack) override;
void apply(BattleObstaclesChanged & pack) override;
void apply(CatapultAttack & pack) override;
const CMap * getMap() const override;
const IGameInfoCallback * getCb() const override;
bool moveHero(ObjectInstanceID hid, int3 dst, EMovementMode mode) override;
void createBoat(const int3 & visitablePosition, BoatId type, PlayerColor initiator) override;
void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits, const MetaString & customTitle) override;
void genericQuery(Query * request, PlayerColor color, std::function<void(std::optional<int32_t>)> callback) override;
private:
CGameHandler * gh;
};