Class ParticleParameter

java.lang.Object
de.gurkenlabs.litiengine.graphics.emitters.xml.ParticleParameter
All Implemented Interfaces:
Serializable

public class ParticleParameter extends Object implements Serializable
Represents a parameter for a particle with a minimum and maximum value.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for ParticleParameter.
    ParticleParameter(float value)
    Constructs a ParticleParameter with the same minimum and maximum value.
    ParticleParameter(float minValue, float maxValue)
    Constructs a ParticleParameter with specified minimum and maximum values.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    get()
    Gets a random value between minValue and maxValue if minValue is less than maxValue, otherwise returns minValue.
    double
    Gets the maximum value.
    double
    Gets the minimum value.
    float
    Gets a random number between minValue and maxValue.
    void
    setMaxValue(double maxValue)
    Sets the maximum value.
    void
    setMinValue(double minValue)
    Sets the minimum value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParticleParameter

      public ParticleParameter()
      Default constructor for ParticleParameter.
    • ParticleParameter

      public ParticleParameter(float value)
      Constructs a ParticleParameter with the same minimum and maximum value.
      Parameters:
      value - The value to be set for both minimum and maximum.
    • ParticleParameter

      public ParticleParameter(float minValue, float maxValue)
      Constructs a ParticleParameter with specified minimum and maximum values.
      Parameters:
      minValue - The minimum value.
      maxValue - The maximum value.
  • Method Details

    • get

      public double get()
      Gets a random value between minValue and maxValue if minValue is less than maxValue, otherwise returns minValue.
      Returns:
      A random value or minValue.
    • getMaxValue

      public double getMaxValue()
      Gets the maximum value.
      Returns:
      The maximum value.
    • getMinValue

      public double getMinValue()
      Gets the minimum value.
      Returns:
      The minimum value.
    • getRandomNumber

      public float getRandomNumber()
      Gets a random number between minValue and maxValue.
      Returns:
      A random number.
    • setMaxValue

      public void setMaxValue(double maxValue)
      Sets the maximum value.
      Parameters:
      maxValue - The maximum value to set.
    • setMinValue

      public void setMinValue(double minValue)
      Sets the minimum value.
      Parameters:
      minValue - The minimum value to set.