Enum Class Transition

java.lang.Object
java.lang.Enum<Transition>
com.csse3200.game.cutscene.models.object.Transition
All Implemented Interfaces:
Serializable, Comparable<Transition>, Constable

public enum Transition extends Enum<Transition>
The different transitions that can happen to image (character sprites and backgrounds)
  • Enum Constant Details

    • FADE

      public static final Transition FADE
      Fades into or out of existence by a defined time (in MS)
    • SLIDE

      public static final Transition SLIDE
      Slides into or out of frame (only for character sprites) depending on the position defined.
    • POP

      public static final Transition POP
      "Pops" or moves the sprite when creating, destroying, or replacing it
    • REPLACE

      public static final Transition REPLACE
      In place replace with no animation
  • Method Details

    • values

      public static Transition[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Transition valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromString

      public static Transition fromString(String value)
      Maps JSON values "fade"|"slide"|"pop"|"replace" to their Transition counterparts.
      Parameters:
      value - - String value to be converted
      Returns:
      Transition value corresponding to the input string
    • toString

      public String toString()

      Converts each enum value to their string versions

      Overrides:
      toString in class Enum<Transition>
      Returns:
      The string version of each enum
    • displayNames

      public static List<String> displayNames()
      Converts each element to its string version to be returned as a list of strings.
      Returns:
      A list of strings containing the string values for each enum element