diff options
Diffstat (limited to 'src/particlecontainer.h')
-rw-r--r-- | src/particlecontainer.h | 45 |
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 |