C# Class Project290.Particles.ParticleContainer

Used for storing a large number of Particles. This efficiently handles storing and updating them.
Mostra file Open project: scastle/Solitude Class Usage Examples

Public Methods

Method Description
Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, byte actionUniqueIdentifier, ParticleAction action ) : bool

Adds a Particle.

Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, float rotationSpeed, byte actionUniqueIdentifier, ParticleAction action ) : bool

Adds a Particle.

ApplyAcceloration ( Vector2 &acceloration ) : void

Applies the acceloration to all particles.

Draw ( ) : void

Draws this instance.

ParticleContainer ( int maxParticles ) : System

Initializes a new instance of the ParticleContainer class.

Reset ( ) : void

Resets this instance.

Update ( ) : void

Updates this instance.

Private Methods

Method Description
CheckToSeeIfGameClockReset ( ) : void

Checks to see if game clock reset.

Method Details

Add() public method

Adds a Particle.
public Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, byte actionUniqueIdentifier, ParticleAction action ) : bool
xPosition float The x position.
yPosition float The y position.
xVelocity float The x velocity.
yVelocity float The y velocity.
color Color The color to overlay the drawn image with.
scale float The scale.
rotation float The rotation.
actionUniqueIdentifier byte This is used to identify what "type" in a custom action this particle belongs to. /// For example, you may want to have one action which could draw one of several different /// images. You can set this value to indicate which image to draw. This does not have /// to be used.
action ParticleAction The action. This should be a reference to a STATIC object, for memory sake.
return bool

Add() public method

Adds a Particle.
public Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, float rotationSpeed, byte actionUniqueIdentifier, ParticleAction action ) : bool
xPosition float The x position.
yPosition float The y position.
xVelocity float The x velocity.
yVelocity float The y velocity.
color Color The color to overlay the drawn image with.
scale float The scale.
rotation float The rotation.
rotationSpeed float The rotation speed.
actionUniqueIdentifier byte This is used to identify what "type" in a custom action this particle belongs to. /// For example, you may want to have one action which could draw one of several different /// images. You can set this value to indicate which image to draw. This does not have /// to be used.
action ParticleAction The action. This should be a reference to a STATIC object, for memory sake.
return bool

ApplyAcceloration() public method

Applies the acceloration to all particles.
public ApplyAcceloration ( Vector2 &acceloration ) : void
acceloration Vector2 The acceloration.
return void

Draw() public method

Draws this instance.
public Draw ( ) : void
return void

ParticleContainer() public method

Initializes a new instance of the ParticleContainer class.
public ParticleContainer ( int maxParticles ) : System
maxParticles int The maximum number of particles.
return System

Reset() public method

Resets this instance.
public Reset ( ) : void
return void

Update() public method

Updates this instance.
public Update ( ) : void
return void