Class ParticleVariables

java.lang.Object
wtf.choco.dragoneggdrop.particle.ParticleVariables

public final class ParticleVariables
extends Object
Represents a set of variables to be used when parsing and evaluating an expression in a ParticleShapeDefinition.
Author:
Parker Hawke - Choco
  • Constructor Summary

    Constructors
    Constructor Description
    ParticleVariables()
    Construct a new set of variables where all values are initialized to 0.0
    ParticleVariables​(double x, double y, double z, double t, double theta)
    Construct a new set of variables.
  • Method Summary

    Modifier and Type Method Description
    double get​(String name, double defaultValue)
    Get a variable by its name.
    double getT()
    Get the t variable.
    double getTheta()
    Get the theta variable.
    double getX()
    Get the x variable.
    double getY()
    Get the y variable.
    double getZ()
    Get the z variable.

    Methods inherited from class java.lang.Object

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

    • ParticleVariables

      public ParticleVariables​(double x, double y, double z, double t, double theta)
      Construct a new set of variables.
      Parameters:
      x - the initial x value
      y - the initial y value
      z - the initial z value
      t - the initial t value
      theta - the initial theta value
    • ParticleVariables

      public ParticleVariables()
      Construct a new set of variables where all values are initialized to 0.0
  • Method Details

    • getX

      public double getX()
      Get the x variable.
      Returns:
      x
    • getY

      public double getY()
      Get the y variable.
      Returns:
      y
    • getZ

      public double getZ()
      Get the z variable.
      Returns:
      z
    • getT

      public double getT()
      Get the t variable.
      Returns:
      t
    • getTheta

      public double getTheta()
      Get the theta variable.
      Returns:
      theta
    • get

      public double get​(String name, double defaultValue)
      Get a variable by its name.
      Parameters:
      name - the variable name
      defaultValue - the default value to return if no variable with the given name could be found
      Returns:
      the value of the variable