1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Add more "const"

This commit is contained in:
AlexVinS
2014-11-23 14:10:29 +03:00
parent 752965ff69
commit 6dbed27b65
3 changed files with 12 additions and 12 deletions

View File

@@ -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;
};

View File

@@ -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
}

View File

@@ -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;
};