Packagecom.desuade.partigen.pools
Classpublic class SweepPool
InheritanceSweepPool Inheritance NullPool Inheritance Pool Inheritance Object

Language Version : ActionScript 3
Since : 07.22.2009
Runtime Versions : AIR 1.0, Flash Player 9.0.0

This offers basic object storage (without real 'pooling') and removes objects in intervals.



Public Properties
 PropertyDefined By
  interval : int
[read-only] The current interval in ms for each sweep.
SweepPool
 Inheritedlength : int
[read-only] Returns the total amount of particles in the pool.
Pool
 InheritedonLastParticle : Function
The method to call each time the last living particle returns to the pool.
Pool
 InheritedparticleClass : Class
[read-only] Gets the class of particle the pool creates.
Pool
 Inheritedparticles : Dictionary
[read-only] A Dictionary object of all the current "living" particles.
Pool
Public Methods
 MethodDefined By
  
SweepPool(particleClass:Class, interval:int = 4000)
Creates a SweepPool to store particle objects.
SweepPool
 Inherited
[override] Adds a new particle to the Pool.
NullPool
 Inherited
purge():void
This does nothing for Sweep and Null pools.
Pool
  
removeParticle(particle:*):void
[override] Removes the specified particle from the Pool. If you're trying to remove a particle through custom code, it is recommended to simply call particle.kill() than to work directly with the pool.
SweepPool
 Inherited
setClass(particleClass:Class):void
This sets the particleClass to the new class and deals with reseting the internal pool.
Pool
  
startSweeper(interval:int):void
This starts the sweeper to periodically remove objects from the pool.
SweepPool
  
This stops the sweeper.
SweepPool
  
sweep(o:Object):void
This deletes the objects that have been marked for removal by the pool all at once.
SweepPool
Property Detail
intervalproperty
interval:int  [read-only]

The current interval in ms for each sweep.


Implementation
    public function get interval():int
Constructor Detail
SweepPool()Constructor
public function SweepPool(particleClass:Class, interval:int = 4000)

Creates a SweepPool to store particle objects. This can be used with multiple emitters.

Parameters
particleClass:Class — The class of particle the pool will create.
 
interval:int (default = 4000) — The interval in ms to run a sweep.
Method Detail
removeParticle()method
override public function removeParticle(particle:*):void

Removes the specified particle from the Pool.

If you're trying to remove a particle through custom code, it is recommended to simply call particle.kill() than to work directly with the pool.

Parameters

particle:* — The particle to remove.

startSweeper()method 
public function startSweeper(interval:int):void

This starts the sweeper to periodically remove objects from the pool.

Parameters

interval:int — The interval in ms to run a sweep.

stopSweeper()method 
public function stopSweeper():void

This stops the sweeper.

sweep()method 
public function sweep(o:Object):void

This deletes the objects that have been marked for removal by the pool all at once.

Parameters

o:Object