From d87153a61093a7994480a1a17e1757f96f051b23 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Tue, 25 Nov 2014 15:00:34 +0300 Subject: [PATCH] Hide mechanics classes --- lib/SpellMechanics.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++ lib/SpellMechanics.h | 79 ----------------------------------------- 2 files changed, 80 insertions(+), 79 deletions(-) diff --git a/lib/SpellMechanics.cpp b/lib/SpellMechanics.cpp index d16d840f9..2ffc3bf7b 100644 --- a/lib/SpellMechanics.cpp +++ b/lib/SpellMechanics.cpp @@ -120,6 +120,86 @@ namespace SRSLPraserHelpers } +class DefaultSpellMechanics: public ISpellMechanics +{ +public: + DefaultSpellMechanics(CSpell * s): ISpellMechanics(s){}; + + std::vector rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr) const override; + std::set getAffectedStacks(SpellTargetingContext & ctx) const override; + + ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; + + //bool adventureCast(const SpellCastContext & context) const override; + bool battleCast(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters) const override; +}; + +class ObstacleMechanics: public DefaultSpellMechanics +{ +public: + ObstacleMechanics(CSpell * s): DefaultSpellMechanics(s){}; + +}; + +class WallMechanics: public ObstacleMechanics +{ +public: + WallMechanics(CSpell * s): ObstacleMechanics(s){}; + std::vector rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr) const override; + +}; + + +class ChainLightningMechanics: public DefaultSpellMechanics +{ +public: + ChainLightningMechanics(CSpell * s): DefaultSpellMechanics(s){}; + std::set getAffectedStacks(SpellTargetingContext & ctx) const override; +}; + +class CloneMechanics: public DefaultSpellMechanics +{ +public: + CloneMechanics(CSpell * s): DefaultSpellMechanics(s){}; + ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; +}; + +class DispellHelpfulMechanics: public DefaultSpellMechanics +{ +public: + DispellHelpfulMechanics(CSpell * s): DefaultSpellMechanics(s){}; + ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; +}; + +class HypnotizeMechanics: public DefaultSpellMechanics +{ +public: + HypnotizeMechanics(CSpell * s): DefaultSpellMechanics(s){}; + ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; +}; + +///all rising spells +class RisingSpellMechanics: public DefaultSpellMechanics +{ +public: + RisingSpellMechanics(CSpell * s): DefaultSpellMechanics(s){}; + +}; + +///all rising spells but SACRIFICE +class SpecialRisingSpellMechanics: public RisingSpellMechanics +{ +public: + SpecialRisingSpellMechanics(CSpell * s): RisingSpellMechanics(s){}; + ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; +}; + +class SacrificeMechanics: public RisingSpellMechanics +{ +public: + SacrificeMechanics(CSpell * s): RisingSpellMechanics(s){}; +}; + ///ISpellMechanics ISpellMechanics::ISpellMechanics(CSpell * s): owner(s) diff --git a/lib/SpellMechanics.h b/lib/SpellMechanics.h index 601a96ab0..b54be4bf8 100644 --- a/lib/SpellMechanics.h +++ b/lib/SpellMechanics.h @@ -57,82 +57,3 @@ protected: CSpell * owner; }; -class DefaultSpellMechanics: public ISpellMechanics -{ -public: - DefaultSpellMechanics(CSpell * s): ISpellMechanics(s){}; - - std::vector rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr) const override; - std::set getAffectedStacks(SpellTargetingContext & ctx) const override; - - ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; - - //bool adventureCast(const SpellCastContext & context) const override; - bool battleCast(const SpellCastEnvironment * env, const BattleSpellCastParameters & parameters) const override; -}; - -class ObstacleMechanics: public DefaultSpellMechanics -{ -public: - ObstacleMechanics(CSpell * s): DefaultSpellMechanics(s){}; - -}; - -class WallMechanics: public ObstacleMechanics -{ -public: - WallMechanics(CSpell * s): ObstacleMechanics(s){}; - std::vector rangeInHexes(BattleHex centralHex, ui8 schoolLvl, ui8 side, bool *outDroppedHexes = nullptr) const override; - -}; - - -class ChainLightningMechanics: public DefaultSpellMechanics -{ -public: - ChainLightningMechanics(CSpell * s): DefaultSpellMechanics(s){}; - std::set getAffectedStacks(SpellTargetingContext & ctx) const override; -}; - -class CloneMechanics: public DefaultSpellMechanics -{ -public: - CloneMechanics(CSpell * s): DefaultSpellMechanics(s){}; - ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; -}; - -class DispellHelpfulMechanics: public DefaultSpellMechanics -{ -public: - DispellHelpfulMechanics(CSpell * s): DefaultSpellMechanics(s){}; - ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; -}; - -class HypnotizeMechanics: public DefaultSpellMechanics -{ -public: - HypnotizeMechanics(CSpell * s): DefaultSpellMechanics(s){}; - ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; -}; - -///all rising spells -class RisingSpellMechanics: public DefaultSpellMechanics -{ -public: - RisingSpellMechanics(CSpell * s): DefaultSpellMechanics(s){}; - -}; - -///all rising spells but SACRIFICE -class SpecialRisingSpellMechanics: public RisingSpellMechanics -{ -public: - SpecialRisingSpellMechanics(CSpell * s): RisingSpellMechanics(s){}; - ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override; -}; - -class SacrificeMechanics: public RisingSpellMechanics -{ -public: - SacrificeMechanics(CSpell * s): RisingSpellMechanics(s){}; -};