Record Class GameArea.Bounds

java.lang.Object
java.lang.Record
com.csse3200.game.areas.GameArea.Bounds
Enclosing class:
GameArea

protected static record GameArea.Bounds(float leftX, float rightX, float bottomY, float topY, float viewWidth, float viewHeight, com.badlogic.gdx.math.Vector2 camPos) extends Record
Camera bounds helper.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Bounds(float leftX, float rightX, float bottomY, float topY, float viewWidth, float viewHeight, com.badlogic.gdx.math.Vector2 camPos)
    Creates an instance of a Bounds record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    Returns the value of the bottomY record component.
    com.badlogic.gdx.math.Vector2
    Returns the value of the camPos record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the leftX record component.
    float
    Returns the value of the rightX record component.
    float
    Returns the value of the topY record component.
    final String
    Returns a string representation of this record class.
    float
    Returns the value of the viewHeight record component.
    float
    Returns the value of the viewWidth record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Bounds

      protected Bounds(float leftX, float rightX, float bottomY, float topY, float viewWidth, float viewHeight, com.badlogic.gdx.math.Vector2 camPos)
      Creates an instance of a Bounds record class.
      Parameters:
      leftX - the value for the leftX record component
      rightX - the value for the rightX record component
      bottomY - the value for the bottomY record component
      topY - the value for the topY record component
      viewWidth - the value for the viewWidth record component
      viewHeight - the value for the viewHeight record component
      camPos - the value for the camPos record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • leftX

      public float leftX()
      Returns the value of the leftX record component.
      Returns:
      the value of the leftX record component
    • rightX

      public float rightX()
      Returns the value of the rightX record component.
      Returns:
      the value of the rightX record component
    • bottomY

      public float bottomY()
      Returns the value of the bottomY record component.
      Returns:
      the value of the bottomY record component
    • topY

      public float topY()
      Returns the value of the topY record component.
      Returns:
      the value of the topY record component
    • viewWidth

      public float viewWidth()
      Returns the value of the viewWidth record component.
      Returns:
      the value of the viewWidth record component
    • viewHeight

      public float viewHeight()
      Returns the value of the viewHeight record component.
      Returns:
      the value of the viewHeight record component
    • camPos

      public com.badlogic.gdx.math.Vector2 camPos()
      Returns the value of the camPos record component.
      Returns:
      the value of the camPos record component