DefaultParticleFactory class

Default implementation of IParticleFactory that creates randomly configured particles

This factory generates particles with:

  • Random positions within the specified bounds
  • Random velocities within -maxSpeed, maxSpeed range
  • Random sizes between 1 and maxSize
  • Uniform color (configurable)

Mathematical Distributions:

  • Position: Uniform across available space
  • Velocity: Uniform in direction, magnitude up to maxSpeed
  • Size: Uniform between 1 and maxSize pixels
Implemented types

Constructors

DefaultParticleFactory.new({required Random random, required double maxSpeed, required double maxSize, required Color color})
Creates a particle factory with specified randomization parameters

Properties

color Color
final
hashCode int
The hash code for this object.
no setterinherited
maxSize double
final
maxSpeed double
final
random Random
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createParticle(Size size) Particle
Creates a new particle within specified bounds
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited