Class Component.XY

java.lang.Object
tripleplay.entity.Component
tripleplay.entity.Component.XY
Enclosing class:
Component

public static final class Component.XY extends Component
A component implementation for a pair of floats.
  • Nested Class Summary

    Nested classes/interfaces inherited from class tripleplay.entity.Component

    Component.FScalar, Component.Generic<T>, Component.IMask, Component.IScalar, Component.XY
  • Field Summary

    Fields inherited from class tripleplay.entity.Component

    world
  • Constructor Summary

    Constructors
    Constructor
    Description
    XY(World world)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int entityId, float dx, float dy)
    Adds dx and dy to the x and y components for entityId.
    pythagoras.f.Dimension
    get(int entityId, pythagoras.f.Dimension into)
    Writes the x/y components of the point for entityId into into.
    pythagoras.f.Point
    get(int entityId, pythagoras.f.Point into)
    Writes the x/y components of the point for entityId into into.
    pythagoras.f.Vector
    get(int entityId, pythagoras.f.Vector into)
    Writes the x/y components of the point for entityId into into.
    float
    getX(int entityId)
    Returns the x component of the point for entityId.
    float
    getY(int entityId)
    Returns the y component of the point for entityId.
    void
    set(int entityId, float x, float y)
    Updates the x/y components of the point for entityId.
    void
    set(int entityId, pythagoras.f.XY value)
    Updates the x/y components of the point for entityId.
    void
    set(int entityId, Component.XY other)
    Copies the value of other for entityId to this component.
    void
    setX(int entityId, float x)
    Updates the x component of the point for entityId.
    void
    setY(int entityId, float y)
    Updates the y component of the point for entityId.

    Methods inherited from class tripleplay.entity.Component

    toString

    Methods inherited from class java.lang.Object

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

    • XY

      public XY(World world)
  • Method Details

    • getX

      public float getX(int entityId)
      Returns the x component of the point for entityId.
    • getY

      public float getY(int entityId)
      Returns the y component of the point for entityId.
    • get

      public pythagoras.f.Point get(int entityId, pythagoras.f.Point into)
      Writes the x/y components of the point for entityId into into.
      Returns:
      into for easy method chaining.
    • get

      public pythagoras.f.Vector get(int entityId, pythagoras.f.Vector into)
      Writes the x/y components of the point for entityId into into.
      Returns:
      into for easy method chaining.
    • get

      public pythagoras.f.Dimension get(int entityId, pythagoras.f.Dimension into)
      Writes the x/y components of the point for entityId into into.
      Returns:
      into for easy method chaining.
    • setX

      public void setX(int entityId, float x)
      Updates the x component of the point for entityId.
    • setY

      public void setY(int entityId, float y)
      Updates the y component of the point for entityId.
    • set

      public void set(int entityId, pythagoras.f.XY value)
      Updates the x/y components of the point for entityId.
    • set

      public void set(int entityId, float x, float y)
      Updates the x/y components of the point for entityId.
    • set

      public void set(int entityId, Component.XY other)
      Copies the value of other for entityId to this component.
    • add

      public void add(int entityId, float dx, float dy)
      Adds dx and dy to the x and y components for entityId.