AlexVinS пре 11 година
родитељ
комит
6dbed27b65
3 измењених фајлова са 12 додато и 12 уклоњено
  1. 5 5
      lib/CSpellHandler.h
  2. 3 3
      lib/SpellMechanics.cpp
  3. 4 4
      lib/SpellMechanics.h

+ 5 - 5
lib/CSpellHandler.h

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

+ 3 - 3
lib/SpellMechanics.cpp

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

+ 4 - 4
lib/SpellMechanics.h

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