Record Class CharacterEnterData
java.lang.Object
java.lang.Record
com.csse3200.game.cutscene.models.object.actiondata.CharacterEnterData
- Record Components:
character
- The character object containing character info (id, name, and poses)pose
- The pose the character will be rendered inposition
- The position on screen the character will be rendered intransition
- 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 CharacterEnterData(Character character, String pose, Position position, Transition transition, int duration, boolean await)
extends Record
implements ActionData
Stores data for the character.enter event
-
Constructor Summary
ConstructorsConstructorDescriptionCharacterEnterData
(Character character, String pose, Position position, Transition transition, int duration, boolean await) Creates an instance of aCharacterEnterData
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.pose()
Returns the value of thepose
record component.position()
Returns the value of theposition
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetransition
record component.
-
Constructor Details
-
CharacterEnterData
public CharacterEnterData(Character character, String pose, Position position, Transition transition, int duration, boolean await) Creates an instance of aCharacterEnterData
record class.- Parameters:
character
- the value for thecharacter
record componentpose
- the value for thepose
record componentposition
- the value for theposition
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
-
pose
Returns the value of thepose
record component.- Returns:
- the value of the
pose
record component
-
position
Returns the value of theposition
record component.- Returns:
- the value of the
position
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
-