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" produces move_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

    Constructors
    Constructor
    Description
    TutorialClip(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 Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the folder record component.
    float
    fps()
    Returns the value of the fps record component.
    int
    Returns the value of the frameCount record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the loop record component.
    Returns the value of the pattern record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TutorialClip

      public TutorialClip(String folder, String pattern, int frameCount, float fps, boolean loop)
      Creates a clip description for building an animation from numbered PNG frames.
      Parameters:
      folder - the folder containing all frames (relative to assets root), not null
      pattern - filename pattern for frames, suitable for String.format(java.lang.String, java.lang.Object...); should include an integer placeholder
      frameCount - total frame count (must be ≥ 1)
      fps - playback frames per second (must be > 0)
      loop - whether playback should loop
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • folder

      public String folder()
      Returns the value of the folder record component.
      Returns:
      the value of the folder record component
    • pattern

      public String pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • frameCount

      public int frameCount()
      Returns the value of the frameCount record component.
      Returns:
      the value of the frameCount record component
    • fps

      public float fps()
      Returns the value of the fps record component.
      Returns:
      the value of the fps record component
    • loop

      public boolean loop()
      Returns the value of the loop record component.
      Returns:
      the value of the loop record component