Record Class BackgroundSetData
java.lang.Object
java.lang.Record
com.csse3200.game.cutscene.models.object.actiondata.BackgroundSetData
- Record Components:
background
- The background object containing background info (image & id)transition
- How the background will transition into existence (Transition enum)duration
- How long the transition will takeawait
- Wait for transition to complete before continuing
- All Implemented Interfaces:
ActionData
public record BackgroundSetData(Background background, Transition transition, int duration, boolean await)
extends Record
implements ActionData
Stores data for the background.set event
-
Constructor Summary
ConstructorsConstructorDescriptionBackgroundSetData
(Background background, Transition transition, int duration, boolean await) Creates an instance of aBackgroundSetData
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
await()
Returns the value of theawait
record component.Returns the value of thebackground
record component.int
duration()
Returns the value of theduration
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.final String
toString()
Returns a string representation of this record class.Returns the value of thetransition
record component.
-
Constructor Details
-
BackgroundSetData
Creates an instance of aBackgroundSetData
record class.- Parameters:
background
- the value for thebackground
record componenttransition
- the value for thetransition
record componentduration
- the value for theduration
record componentawait
- the value for theawait
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 '=='. -
background
Returns the value of thebackground
record component.- Returns:
- the value of the
background
record component
-
transition
Returns the value of thetransition
record component.- Returns:
- the value of the
transition
record component
-
duration
public int duration()Returns the value of theduration
record component.- Returns:
- the value of the
duration
record component
-
await
public boolean await()Returns the value of theawait
record component.- Returns:
- the value of the
await
record component
-