mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Queries refactoring
* Moved SUMMON_BOAT special case to mechanics * Partially moved Town portal logic to mechanics class * Added generic query reply to CCallback * Redesigned Queries so that base API do not depends on CGameHandler * Got rid of CGameHandler::castSpellRequest * Removed CGameHandler::castSpell * Added new Query type for town portal dialog (not used yet)
This commit is contained in:
@ -246,6 +246,11 @@ void SpellCastContext::afterCast()
|
||||
}
|
||||
|
||||
///DefaultSpellMechanics
|
||||
DefaultSpellMechanics::DefaultSpellMechanics(const CSpell * s):
|
||||
ISpellMechanics(s)
|
||||
{
|
||||
};
|
||||
|
||||
void DefaultSpellMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
|
||||
{
|
||||
if (packet->castByHero)
|
||||
@ -884,6 +889,12 @@ bool DefaultSpellMechanics::requiresCreatureTarget() const
|
||||
return true;
|
||||
}
|
||||
|
||||
///SpecialSpellMechanics
|
||||
SpecialSpellMechanics::SpecialSpellMechanics(const CSpell * s):
|
||||
DefaultSpellMechanics(s)
|
||||
{
|
||||
}
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem SpecialSpellMechanics::canBeCast(const CBattleInfoCallback * cb, const SpellTargetingContext & ctx) const
|
||||
{
|
||||
//no problems by default
|
||||
|
Reference in New Issue
Block a user