summaryrefslogtreecommitdiff
path: root/src/particlecontainer.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:54:01 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-08 21:54:01 +0100
commit337fdc49fc9fd5c041568c30327a9aab66e6080d (patch)
tree4eba7a36fcfda0d4810b56f64850385f26fec3d1 /src/particlecontainer.cpp
parent68760426532b9ca4c6939d7a7b8faa1586ee82e0 (diff)
downloadmana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.gz
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.bz2
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.tar.xz
mana-337fdc49fc9fd5c041568c30327a9aab66e6080d.zip
Mostly code reformatting
Diffstat (limited to 'src/particlecontainer.cpp')
-rw-r--r--src/particlecontainer.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/particlecontainer.cpp b/src/particlecontainer.cpp
index 54a7b315..ddd99ff2 100644
--- a/src/particlecontainer.cpp
+++ b/src/particlecontainer.cpp
@@ -24,7 +24,8 @@
#include "particlecontainer.h"
-ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
+ParticleContainer::ParticleContainer(ParticleContainer *parent,
+ bool delParent):
mDelParent(delParent),
mNext(parent)
{}
@@ -32,7 +33,7 @@ ParticleContainer::ParticleContainer(ParticleContainer *parent, bool delParent):
ParticleContainer::~ParticleContainer()
{
clearLocally();
- if (mNext && mDelParent)
+ if (mDelParent)
delete mNext;
}
@@ -52,11 +53,12 @@ void ParticleContainer::setPositions(float x, float y)
// -- particle list ----------------------------------------
-ParticleList::ParticleList(ParticleContainer *parent, bool delParent) :
+ParticleList::ParticleList(ParticleContainer *parent, bool delParent):
ParticleContainer(parent, delParent)
{}
-ParticleList::~ParticleList() {}
+ParticleList::~ParticleList()
+{}
void ParticleList::addLocally(Particle *particle)
{
@@ -72,10 +74,12 @@ void ParticleList::removeLocally(Particle *particle)
{
for (std::list<Particle *>::iterator it = mElements.begin();
it != mElements.end(); it++)
+ {
if (*it == particle) {
(*it)->kill();
mElements.erase(it);
}
+ }
}
void ParticleList::clearLocally()