Class inorbit

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

public class inorbit extends Object implements com.simsilica.es.EntityComponent, iEntityReference
This component is used for entities that don't have their own coordinates but are in orbit of another entity eg a planet around a sun.

The coordinates of such an entity are the coordinates of the thing it is orbiting. For example a ship in orbit has the coordinates of the planet below.

Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Details

    • distance

      private Integer distance
    • reference

      private com.simsilica.es.EntityId reference
      the actual entity in orbit of.
  • Constructor Details

    • inorbit

      public inorbit(com.simsilica.es.EntityId reference, Integer distance)
      Parameters:
      reference -
      distance -
    • inorbit

      public inorbit(com.simsilica.es.EntityId reference)
  • Method Details

    • getDistance

      public Integer getDistance()
      Returns:
    • getReference

      public com.simsilica.es.EntityId getReference()
      Description copied from interface: iEntityReference
      The EntityId of the entity referred to.

      This may be EntityId.NULL_ID if the entity has not yet been located.

      Specified by:
      getReference in interface iEntityReference
      Returns:
    • toString

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