Add more "const"
This commit is contained in:
1 parent
752965ff69
commit
6dbed27b65
3 files changed
+12
-12
No files matched your search
+5
-5
@@ -87,18 +87,18 @@ public:
|
||||
struct DLL_LINKAGE SpellCastContext
|
||||
{
|
||||
public:
|
||||
SpellCastEnvironment * env;
|
||||
const SpellCastEnvironment * env;
|
||||
|
||||
int spellLvl;
|
||||
// BattleHex destination;
|
||||
ui8 casterSide;
|
||||
PlayerColor casterColor;
|
||||
CGHeroInstance * caster;
|
||||
CGHeroInstance * secHero;
|
||||
const CGHeroInstance * caster;
|
||||
const CGHeroInstance * secHero;
|
||||
int usedSpellPower;
|
||||
ECastingMode::ECastingMode mode;
|
||||
CStack * targetStack;
|
||||
CStack * selectedStack;
|
||||
const CStack * targetStack;
|
||||
const CStack * selectedStack;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -129,12 +129,12 @@ ISpellMechanics::ISpellMechanics(CSpell * s):
|
||||
|
||||
///DefaultSpellMechanics
|
||||
|
||||
bool DefaultSpellMechanics::adventureCast(SpellCastContext& context) const
|
||||
bool DefaultSpellMechanics::adventureCast(const SpellCastContext& context) const
|
||||
{
|
||||
return false; //there is no general algorithm for castind adventure spells
|
||||
return false; //there is no general algorithm for casting adventure spells
|
||||
}
|
||||
|
||||
bool DefaultSpellMechanics::battleCast(SpellCastContext& context) const
|
||||
bool DefaultSpellMechanics::battleCast(const SpellCastContext& context) const
|
||||
{
|
||||
return false; //todo; DefaultSpellMechanics::battleCast
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ public:
|
||||
* \return true if no error
|
||||
*
|
||||
*/
|
||||
virtual bool adventureCast(SpellCastContext & context) const = 0;
|
||||
virtual bool battleCast(SpellCastContext & context) const = 0;
|
||||
virtual bool adventureCast(const SpellCastContext & context) const = 0;
|
||||
virtual bool battleCast(const SpellCastContext & context) const = 0;
|
||||
|
||||
protected:
|
||||
CSpell * owner;
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
|
||||
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
|
||||
|
||||
bool adventureCast(SpellCastContext & context) const override;
|
||||
bool battleCast(SpellCastContext & context) const override;
|
||||
bool adventureCast(const SpellCastContext & context) const override;
|
||||
bool battleCast(const SpellCastContext & context) const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user