Package com.csse3200.game.areas
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
ConstructorsModifierConstructorDescriptionprotected
Bounds
(float leftX, float rightX, float bottomY, float topY, float viewWidth, float viewHeight, com.badlogic.gdx.math.Vector2 camPos) Creates an instance of aBounds
record class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
bottomY()
Returns the value of thebottomY
record component.com.badlogic.gdx.math.Vector2
camPos()
Returns the value of thecamPos
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.float
leftX()
Returns the value of theleftX
record component.float
rightX()
Returns the value of therightX
record component.float
topY()
Returns the value of thetopY
record component.final String
toString()
Returns a string representation of this record class.float
Returns the value of theviewHeight
record component.float
Returns the value of theviewWidth
record component.
-
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 aBounds
record class.- Parameters:
leftX
- the value for theleftX
record componentrightX
- the value for therightX
record componentbottomY
- the value for thebottomY
record componenttopY
- the value for thetopY
record componentviewWidth
- the value for theviewWidth
record componentviewHeight
- the value for theviewHeight
record componentcamPos
- the value for thecamPos
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
leftX
public float leftX()Returns the value of theleftX
record component.- Returns:
- the value of the
leftX
record component
-
rightX
public float rightX()Returns the value of therightX
record component.- Returns:
- the value of the
rightX
record component
-
bottomY
public float bottomY()Returns the value of thebottomY
record component.- Returns:
- the value of the
bottomY
record component
-
topY
public float topY()Returns the value of thetopY
record component.- Returns:
- the value of the
topY
record component
-
viewWidth
public float viewWidth()Returns the value of theviewWidth
record component.- Returns:
- the value of the
viewWidth
record component
-
viewHeight
public float viewHeight()Returns the value of theviewHeight
record component.- Returns:
- the value of the
viewHeight
record component
-
camPos
public com.badlogic.gdx.math.Vector2 camPos()Returns the value of thecamPos
record component.- Returns:
- the value of the
camPos
record component
-