summaryrefslogtreecommitdiff
path: root/src/particlecontainer.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-02 16:21:43 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-02 16:35:24 +0300
commite0ae701192472d7dd1ae80d78308c4f4a9ef4ec6 (patch)
tree9765a6516e4a6e284ed7b589090db7f1f4cd80ea /src/particlecontainer.h
parent962f182fcc989ec587282e44f889188ce241ba31 (diff)
downloadmv-e0ae701192472d7dd1ae80d78308c4f4a9ef4ec6.tar.gz
mv-e0ae701192472d7dd1ae80d78308c4f4a9ef4ec6.tar.bz2
mv-e0ae701192472d7dd1ae80d78308c4f4a9ef4ec6.tar.xz
mv-e0ae701192472d7dd1ae80d78308c4f4a9ef4ec6.zip
Add const to more classes.
Diffstat (limited to 'src/particlecontainer.h')
-rw-r--r--src/particlecontainer.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/particlecontainer.h b/src/particlecontainer.h
index 4e402044b..f83b62d1a 100644
--- a/src/particlecontainer.h
+++ b/src/particlecontainer.h
@@ -44,8 +44,8 @@ public:
*
* delParent means that the destructor should also free the parent.
*/
- ParticleContainer(ParticleContainer *parent = nullptr,
- bool delParent = true);
+ ParticleContainer(ParticleContainer *const parent = nullptr,
+ const bool delParent = true);
virtual ~ParticleContainer();
@@ -63,7 +63,7 @@ public:
/**
* Sets the positions of all elements
*/
- virtual void moveTo(float x, float y);
+ virtual void moveTo(const float x, const float y);
protected:
bool mDelParent; /**< Delete mNext in destructor */
@@ -76,22 +76,23 @@ protected:
class ParticleList : public ParticleContainer
{
public:
- ParticleList(ParticleContainer *parent = nullptr, bool delParent = true);
+ ParticleList(ParticleContainer *const parent = nullptr,
+ const bool delParent = true);
virtual ~ParticleList();
/**
* Takes control of and adds a particle
*/
- void addLocally(Particle *);
+ void addLocally(Particle *const particle);
/**
* `kills' and removes a particle
*/
- void removeLocally(Particle *);
+ void removeLocally(const Particle *const particle);
virtual void clearLocally();
- virtual void moveTo(float x, float y);
+ virtual void moveTo(const float x, const float y);
protected:
std::list<Particle *> mElements; /**< Contained particle effects */
@@ -103,22 +104,24 @@ protected:
class ParticleVector : public ParticleContainer
{
public:
- ParticleVector(ParticleContainer *parent = nullptr, bool delParent = true);
+ ParticleVector(ParticleContainer *const parent = nullptr,
+ const bool delParent = true);
+
virtual ~ParticleVector();
/**
* Sets a particle at a specified index. Kills the previous particle
* there, if needed.
*/
- virtual void setLocally(int index, Particle *particle);
+ virtual void setLocally(const int index, Particle *const particle);
/**
* Removes a particle at a specified index
*/
- virtual void delLocally(int index);
+ virtual void delLocally(const int index);
virtual void clearLocally();
- virtual void moveTo(float x, float y);
+ virtual void moveTo(const float x, const float y);
protected:
std::vector<Particle *> mIndexedElements;