From c8e22bbb7cc1531b09b994e06a58fd8c4664b7bb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 May 2014 20:03:06 +0300 Subject: Move particlelist into separate file. --- src/particle/particlecontainer.cpp | 71 -------------------------------------- 1 file changed, 71 deletions(-) (limited to 'src/particle/particlecontainer.cpp') 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::iterator ParticleListIter; -typedef std::list::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::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::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, -- cgit v1.2.3-70-g09d2