summaryrefslogtreecommitdiff
path: root/src/actorsprite.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-25 01:52:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-25 02:16:11 +0300
commitda457cf152d5aff51d859c18d3668682348dbf7a (patch)
tree6ec10caec1fc472f2ef3c7664a1c536434df1c0f /src/actorsprite.h
parentb474de4a54c9b1d4d863971e40b807588d554436 (diff)
downloadmanaplus-da457cf152d5aff51d859c18d3668682348dbf7a.tar.gz
manaplus-da457cf152d5aff51d859c18d3668682348dbf7a.tar.bz2
manaplus-da457cf152d5aff51d859c18d3668682348dbf7a.tar.xz
manaplus-da457cf152d5aff51d859c18d3668682348dbf7a.zip
change vars or methods to const.
Diffstat (limited to 'src/actorsprite.h')
-rw-r--r--src/actorsprite.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/actorsprite.h b/src/actorsprite.h
index 21ed0ae12..14e2558fd 100644
--- a/src/actorsprite.h
+++ b/src/actorsprite.h
@@ -66,14 +66,14 @@ public:
NUM_TCT
};
- ActorSprite(int id);
+ ActorSprite(const int id);
~ActorSprite();
int getId() const
{ return mId; }
- void setId(int id)
+ void setId(const int id)
{ mId = id; }
/**
@@ -90,7 +90,7 @@ public:
static void actorLogic();
- void setMap(Map* map);
+ void setMap(Map *const map);
/**
* Gets the way the object blocks pathfinding for other objects
@@ -101,7 +101,7 @@ public:
/**
* Take control of a particle.
*/
- void controlParticle(Particle *particle);
+ void controlParticle(Particle *const particle);
/**
* Returns the required size of a target cursor for this being.
@@ -118,7 +118,7 @@ public:
/**
* Sets the target animation for this actor.
*/
- void setTargetType(TargetCursorType type);
+ void setTargetType(const TargetCursorType type);
/**
* Untargets the actor.
@@ -132,21 +132,21 @@ public:
*
* \param effectId ID of the effect to trigger
*/
- virtual void triggerEffect(int effectId)
+ virtual void triggerEffect(const int effectId)
{ internalTriggerEffect(effectId, false, true); }
/**
* Sets the actor's stun mode. If zero, the being is `normal', otherwise it
* is `stunned' in some fashion.
*/
- void setStunMode(uint16_t stunMode)
+ void setStunMode(const uint16_t stunMode)
{
if (mStunMode != stunMode)
updateStunMode(mStunMode, stunMode);
mStunMode = stunMode;
}
- void setStatusEffect(int index, bool active);
+ void setStatusEffect(const int index, const bool active);
/**
* A status effect block is a 16 bit mask of status effects. We assign each
@@ -154,9 +154,9 @@ public:
*
* These are NOT the same as the status effect indices.
*/
- void setStatusEffectBlock(int offset, uint16_t flags);
+ void setStatusEffectBlock(const int offset, const uint16_t flags);
- virtual void setAlpha(float alpha)
+ virtual void setAlpha(const float alpha)
{ CompoundSprite::setAlpha(alpha); }
virtual float getAlpha() const
@@ -175,12 +175,12 @@ public:
/**
* Add an ActorSprite listener.
*/
- void addActorSpriteListener(ActorSpriteListener *listener);
+ void addActorSpriteListener(ActorSpriteListener *const listener);
/**
* Remove an ActorSprite listener.
*/
- void removeActorSpriteListener(ActorSpriteListener *listener);
+ void removeActorSpriteListener(ActorSpriteListener *const listener);
protected:
/**
@@ -190,19 +190,20 @@ protected:
* \param sfx Whether to trigger sound effects
* \param gfx Whether to trigger graphical effects
*/
- void internalTriggerEffect(int effectId, bool sfx, bool gfx);
+ void internalTriggerEffect(const int effectId, const bool sfx,
+ const bool gfx);
/**
* Notify self that the stun mode has been updated. Invoked by
* setStunMode if something changed.
*/
- virtual void updateStunMode(int oldMode, int newMode);
+ virtual void updateStunMode(const int oldMode, const int newMode);
/**
* Notify self that a status effect has flipped.
* The new flag is passed.
*/
- virtual void updateStatusEffect(int index, bool newStatus);
+ virtual void updateStatusEffect(const int index, const bool newStatus);
/**
* Handle an update to a status or stun effect
@@ -210,10 +211,12 @@ protected:
* \param The StatusEffect to effect
* \param effectId -1 for stun, otherwise the effect index
*/
- virtual void handleStatusEffect(StatusEffect *effect, int effectId);
+ virtual void handleStatusEffect(StatusEffect *const effect,
+ const int effectId);
void setupSpriteDisplay(const SpriteDisplay &display,
- bool forceDisplay = true, int imageType = 0,
+ const bool forceDisplay = true,
+ const int imageType = 0,
std::string color = "");
int mId;
@@ -238,7 +241,8 @@ private:
* Helper function for loading target cursors
*/
static void loadTargetCursor(const std::string &filename,
- int width, int height, int type, int size);
+ const int width, const int height,
+ const int type, const int size);
/** Images of the target cursor. */
static ImageSet *targetCursorImages[NUM_TCT][NUM_TC];