Record Class TutorialClip
java.lang.Object
java.lang.Record
com.csse3200.game.components.screens.TutorialClip
- Record Components:
folder
- Folder containing the PNG frames, relative to the assets root.pattern
-String.format(String, Object...)
pattern for frame filenames, typically including a numeric placeholder (e.g.,"%03d"
).Example:
"move_%03d.png"
producesmove_000.png
,move_001.png
, …frameCount
- Total number of frames available for this clip (must be ≥ 1).fps
- Playback rate in frames per second (must be > 0).loop
- Whether playback should loop when it reaches the final frame.
public record TutorialClip(String folder, String pattern, int frameCount, float fps, boolean loop)
extends Record
Immutable description of an animated tutorial clip composed of sequential PNG frames.
A TutorialClip
specifies where frame images are located, how they are named,
how many frames there are, and how they should be played (rate and looping).
Rendering logic (e.g., AnimatedClipImage
) uses this metadata to load and
animate the frames.
Example: folder = "tutorial/movement" pattern = "move_%03d.png" // results in move_000.png, move_001.png, ... frameCount = 60 fps = 30f loop = true
-
Constructor Summary
ConstructorsConstructorDescriptionTutorialClip
(String folder, String pattern, int frameCount, float fps, boolean loop) Creates a clip description for building an animation from numbered PNG frames. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.folder()
Returns the value of thefolder
record component.float
fps()
Returns the value of thefps
record component.int
Returns the value of theframeCount
record component.final int
hashCode()
Returns a hash code value for this object.boolean
loop()
Returns the value of theloop
record component.pattern()
Returns the value of thepattern
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
TutorialClip
Creates a clip description for building an animation from numbered PNG frames.- Parameters:
folder
- the folder containing all frames (relative to assets root), notnull
pattern
- filename pattern for frames, suitable forString.format(java.lang.String, java.lang.Object...)
; should include an integer placeholderframeCount
- total frame count (must be ≥ 1)fps
- playback frames per second (must be > 0)loop
- whether playback should loop
-
-
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 '=='. -
folder
Returns the value of thefolder
record component.- Returns:
- the value of the
folder
record component
-
pattern
Returns the value of thepattern
record component.- Returns:
- the value of the
pattern
record component
-
frameCount
public int frameCount()Returns the value of theframeCount
record component.- Returns:
- the value of the
frameCount
record component
-
fps
public float fps()Returns the value of thefps
record component.- Returns:
- the value of the
fps
record component
-
loop
public boolean loop()Returns the value of theloop
record component.- Returns:
- the value of the
loop
record component
-