Class physical

java.lang.Object
name.moore.kevin.ze.components.physical
All Implemented Interfaces:
com.simsilica.es.EntityComponent

public class physical extends Object implements com.simsilica.es.EntityComponent
A component that holds static physical properties such as size or mass. Not all fields will be relevant but all will have default values if not set.
Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy>
    An amount of energy.
    private org.jscience.physics.amount.Amount<javax.measure.quantity.Mass>
    An actual real world mass, defaulted to 0kg
    private Float
    A relative size, typically held in a <size> XML element
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
    physical​(Float s, org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> m)
     
    physical​(Float s, org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> m, org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> e)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.jscience.physics.amount.Amount<javax.measure.quantity.Energy>
     
    org.jscience.physics.amount.Amount<javax.measure.quantity.Mass>
     
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • size

      private Float size
      A relative size, typically held in a <size> XML element
    • mass

      private org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> mass
      An actual real world mass, defaulted to 0kg
    • energy

      private org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> energy
      An amount of energy. This may have different effects depending on the entity using it. eg a shield will use this as the maximum amount of energy it can absorb. Defaulted to 0J
  • Constructor Details

    • physical

      public physical(Float s)
      Parameters:
      s -
    • physical

      public physical(Float s, org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> m)
      Parameters:
      s -
      m -
    • physical

      public physical(Float s, org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> m, org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> e)
      Parameters:
      s -
      m -
      e -
    • physical

      public physical()
  • Method Details

    • getSize

      public Float getSize()
      Returns:
    • getMass

      public org.jscience.physics.amount.Amount<javax.measure.quantity.Mass> getMass()
      Returns:
    • getEnergy

      public org.jscience.physics.amount.Amount<javax.measure.quantity.Energy> getEnergy()
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: