![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
A particle pool. More...
#include <ParticlePool.h>
Public Types | |
typedef std::list< T * > | PoolList |
typedef PoolList::iterator | PoolIterator |
Public Member Functions | |
ParticlePool () | |
Constructor. More... | |
virtual | ~ParticlePool () |
Destructor. More... | |
bool | IsEmpty () |
Checks if the pool is empty. More... | |
size_t | GetSize () |
Retrieves the pool size. More... | |
void | ResetIterator () |
Resets the pool iterator. More... | |
T * | GetFirst () |
Retrieves the first particle. More... | |
T * | GetNext () |
Retrieves the next particle in the pool. More... | |
bool | End () |
Checks if the iterator is at the end of the pool. More... | |
void | Clear () |
Removes all particles. More... | |
void | AddElement (T *element) |
Adds a particle to the pool. More... | |
T * | ReleaseElement () |
Releases a locked particle. More... | |
void | ReleaseAllElements () |
Releases all locked particles. More... | |
void | LockLatestElement () |
Locks the released particle pointed by the iterator. More... | |
void | LockAllElements () |
Locks all particles. More... | |
std::list< T * > & | GetActiveElementsList () |
Retrieves the list of released particles. More... | |
Protected Attributes | |
PoolList | released_ |
List with released particles. More... | |
PoolList | locked_ |
List with locked particles. More... | |
PoolIterator | pool_iterator_ |
The pool iterator. More... | |
A particle pool.
There are actually two pools, one for locked particles and one for released ones. Locked particles can't be used until they are released.
T | The type of particle. |
typedef PoolList::iterator ParticlePool< T >::PoolIterator |
typedef std::list<T*> ParticlePool< T >::PoolList |
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
inline |
Adds a particle to the pool.
A particle is added in locked state.
[in] | element | Particle to add to the pool. |
|
inline |
Removes all particles.
Removes both locked and released particles.
|
inline |
Checks if the iterator is at the end of the pool.
If it's at the end, {
|
inline |
Retrieves the list of released particles.
|
inline |
Retrieves the first particle.
Before doing so, it resets the pool iterator. It doesn't consider locked particles, only the released ones.
|
inline |
Retrieves the next particle in the pool.
Before doing so, it advances the pool iterator. It doesn't consider locked particles, only the released ones.
|
inline |
Retrieves the pool size.
It doesn't consider locked particles, only the released ones.
|
inline |
Checks if the pool is empty.
It doesn't consider locked particles, only the released ones.
|
inline |
Locks all particles.
The particles get added at the end of the locked list in the same order they were in the released list. The pool iterator is reseted.
|
inline |
Locks the released particle pointed by the iterator.
The particle gets added to the end of the locked particle list.
|
inline |
Releases all locked particles.
It also resets the pool operator.
|
inline |
Releases a locked particle.
The first locked particle will be the one unlocked.
|
inline |
Resets the pool iterator.
|
protected |
List with locked particles.
They can't be operated upon until released.
|
protected |
The pool iterator.
Determines the current particle to be acted upon. Only works for released particles.
|
protected |
List with released particles.
They can be operated upon.