Record Class TextureAtlasLayoutSelection

java.lang.Object
java.lang.Record
dev.turboism.sdk.cubism.textureatlas.TextureAtlasLayoutSelection

@CubismEditor(from="5.0.00") public record TextureAtlasLayoutSelection(String algorithmId, boolean parallel) extends Record
The runtime-owned texture-atlas automatic-layout selection: which registered algorithm the native automatic-layout entry routes to, and whether parallel search is requested.

A null or blank algorithmId is the unset/native default: no choice was ever made and the host's own packing runs. NATIVE_ALGORITHM_ID is the explicit native choice recorded when a user picks the native entry or a caller selects nativeDefault() — it resolves to native packing exactly like the unset state but stays distinguishable from it, so a stored explicit choice is never mistaken for "no selection yet". The "native" id is reserved: it can never be registered by a plugin, so the explicit native choice can never collide with a real algorithm. Any other non-null id is resolved against TextureAtlasLayoutAlgorithmRegistry at invocation time; an id that is not currently registered falls back to the native algorithm rather than failing. Selecting an algorithm never registers it, and registering an algorithm never selects it.

parallel is a request forwarded to TextureAtlasLayoutPlanner.plan(java.util.List, TextureAtlasLayoutConstraints, boolean); algorithms that do not declare supportsParallel ignore it.

  • Field Details

    • NATIVE_ALGORITHM_ID

      public static final String NATIVE_ALGORITHM_ID
      The reserved algorithm id for the explicit native choice. Registration of this id is rejected, so it always resolves to the host's native packing.
      See Also:
  • Constructor Details

    • TextureAtlasLayoutSelection

      public TextureAtlasLayoutSelection(String algorithmId, boolean parallel)
      Creates an instance of a TextureAtlasLayoutSelection record class.
      Parameters:
      algorithmId - the value for the algorithmId record component
      parallel - the value for the parallel record component
  • Method Details

    • nativeDefault

      public static TextureAtlasLayoutSelection nativeDefault()
      Returns:
      the native default selection: no algorithm id, serial packing.
    • isNative

      public boolean isNative()
      Returns:
      whether this selection resolves to the host's native packing — true for both the unset state (null id) and the explicit native choice (NATIVE_ALGORITHM_ID)
    • 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.
    • algorithmId

      public String algorithmId()
      Returns the value of the algorithmId record component.
      Returns:
      the value of the algorithmId record component
    • parallel

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