summaryrefslogtreecommitdiff
path: root/src/particle/particlecontainer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-18 20:03:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-18 20:03:06 +0300
commitc8e22bbb7cc1531b09b994e06a58fd8c4664b7bb (patch)
treee8d4180c64aada75021673c4b6ef97c7aeedbeeb /src/particle/particlecontainer.cpp
parent7da95c7f4da447876458a0b1a17736b9a2865844 (diff)
downloadmanaplus-c8e22bbb7cc1531b09b994e06a58fd8c4664b7bb.tar.gz
manaplus-c8e22bbb7cc1531b09b994e06a58fd8c4664b7bb.tar.bz2
manaplus-c8e22bbb7cc1531b09b994e06a58fd8c4664b7bb.tar.xz
manaplus-c8e22bbb7cc1531b09b994e06a58fd8c4664b7bb.zip
Move particlelist into separate file.
Diffstat (limited to 'src/particle/particlecontainer.cpp')
-rw-r--r--src/particle/particlecontainer.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/particle/particlecontainer.cpp b/src/particle/particlecontainer.cpp
index 52179bce8..68e0c9d6c 100644
--- a/src/particle/particlecontainer.cpp
+++ b/src/particle/particlecontainer.cpp
@@ -27,9 +27,6 @@
#include "debug.h"
-typedef std::list<Particle *>::iterator ParticleListIter;
-typedef std::list<Particle *>::const_iterator ParticleListCIter;
-
ParticleContainer::ParticleContainer(ParticleContainer *const parent,
const bool delParent):
mNext(parent),
@@ -58,74 +55,6 @@ void ParticleContainer::moveTo(const float x, const float y)
mNext->moveTo(x, y);
}
-// -- particle list ----------------------------------------
-
-ParticleList::ParticleList(ParticleContainer *const parent,
- const bool delParent) :
- ParticleContainer(parent, delParent),
- mElements()
-{}
-
-ParticleList::~ParticleList()
-{}
-
-void ParticleList::addLocally(Particle *const particle)
-{
- if (particle)
- {
- // The effect may not die without the beings permission or we segfault
- particle->disableAutoDelete();
- mElements.push_back(particle);
- }
-}
-
-void ParticleList::removeLocally(const Particle *const particle)
-{
- for (std::list<Particle *>::iterator it = mElements.begin();
- it != mElements.end(); )
- {
- Particle *const p = *it;
- if (p == particle)
- {
- p->kill();
- it = mElements.erase(it);
- }
- else
- {
- ++it;
- }
- }
-}
-
-void ParticleList::clearLocally()
-{
- FOR_EACH (ParticleListCIter, it, mElements)
- (*it)->kill();
-
- mElements.clear();
-}
-
-void ParticleList::moveTo(const float x, const float y)
-{
- ParticleContainer::moveTo(x, y);
-
- for (std::list<Particle *>::iterator it = mElements.begin();
- it != mElements.end(); )
- {
- Particle *const p = *it;
- p->moveTo(x, y);
- if (p->isExtinct())
- {
- p->kill();
- it = mElements.erase(it);
- }
- else
- {
- ++it;
- }
- }
-}
-
// -- particle vector ----------------------------------------
ParticleVector::ParticleVector(ParticleContainer *const parent,