summaryrefslogtreecommitdiff
path: root/src/particlecontainer.h
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2008-12-06 21:00:46 -0700
committerFate <fate-tmw@googlemail.com>2008-12-06 21:00:46 -0700
commita7c21e6f8add37af7412449742ec55c8daa8571a (patch)
tree81d7b3eb74f7694aae8a64dd91e1e674e8b326a7 /src/particlecontainer.h
parent28fa707f1ab22e7cac8abff703d534aec3228d5c (diff)
downloadmana-a7c21e6f8add37af7412449742ec55c8daa8571a.tar.gz
mana-a7c21e6f8add37af7412449742ec55c8daa8571a.tar.bz2
mana-a7c21e6f8add37af7412449742ec55c8daa8571a.tar.xz
mana-a7c21e6f8add37af7412449742ec55c8daa8571a.zip
Defrobnicated ParticleContainer inheritance hierarchy
Diffstat (limited to 'src/particlecontainer.h')
-rw-r--r--src/particlecontainer.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/particlecontainer.h b/src/particlecontainer.h
index a6a1b1c8..cf002fbc 100644
--- a/src/particlecontainer.h
+++ b/src/particlecontainer.h
@@ -42,38 +42,56 @@ public:
*
* delParent means that the destructor should also free the parent.
*/
- ParticleContainer(ParticleContainer *parent = NULL, bool delParent = true);
- ~ParticleContainer();
+ ParticleContainer(ParticleContainer *parent = NULL, bool delParent = true);
+ virtual ~ParticleContainer();
/**
- * Takes control of and adds a particle
+ * Kills and removes all particle effects
*/
- void addLocally(Particle *);
+ void clear();
/**
- * `kills' and removes a particle
+ * Kills and removes all particle effects (only in this container)
*/
- void removeLocally(Particle *);
+ virtual void clearLocally() {};
/**
- * Kills and removes all particle effects
+ * Sets the positions of all elements
*/
- void clear();
+ virtual void setPositions(float x, float y);
+
+protected:
+ bool mDelParent; /**< Delete mNext in destructor */
+ ParticleContainer *mNext; /**< Contained container, if any */
+};
+
+
+
+/**
+ * Linked list of particle effects.
+ */
+class ParticleList : public ParticleContainer
+{
+public:
+ ParticleList(ParticleContainer *parent = NULL, bool delParent = true);
+ virtual ~ParticleList();
/**
- * Kills and removes all particle effects (only in this container)
+ * Takes control of and adds a particle
*/
- virtual void clearLocally();
+ void addLocally(Particle *);
/**
- * Sets the positions of all elements
+ * `kills' and removes a particle
*/
+ void removeLocally(Particle *);
+
+ virtual void clearLocally();
+
virtual void setPositions(float x, float y);
protected:
- bool mDelParent; /**< Delete mNext in destructor */
std::list<Particle *> mElements; /**< Contained particle effects */
- ParticleContainer *mNext; /**< Contained container, if any */
};
@@ -84,6 +102,7 @@ class ParticleVector : public ParticleContainer
{
public:
ParticleVector(ParticleContainer *parent = NULL, bool delParent = true);
+ virtual ~ParticleVector();
/**
* Sets a particle at a specified index. Kills the previous particle