Record Class CharacterExitData
java.lang.Object
java.lang.Record
com.csse3200.game.cutscene.models.object.actiondata.CharacterExitData
- Record Components:
character
- The character object containing character info (id, name, and poses)transition
- The transition that happens to the character spriteduration
- How long the transition will takeawait
- Wait for the transition to complete before continuing
- All Implemented Interfaces:
ActionData
public record CharacterExitData(Character character, Transition transition, int duration, boolean await)
extends Record
implements ActionData
Stores data for the character.exit event
-
Constructor Summary
ConstructorsConstructorDescriptionCharacterExitData
(Character character, Transition transition, int duration, boolean await) Creates an instance of aCharacterExitData
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
await()
Returns the value of theawait
record component.Returns the value of thecharacter
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
-
CharacterExitData
Creates an instance of aCharacterExitData
record class.- Parameters:
character
- the value for thecharacter
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 '=='. -
character
Returns the value of thecharacter
record component.- Returns:
- the value of the
character
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
-