Package io.github.toxicity188.javamesh
Record Class MeshNamedImage
java.lang.Object
java.lang.Record
io.github.toxicity188.javamesh.MeshNamedImage
- Record Components:
images- images keyed by material or texture file name
Stores mesh textures by name so parsed material references can be resolved during conversion.
var images = new MeshNamedImage(Map.of("blade.png", MeshImage.from(bufferedImage)));
MeshImage blade = images.get("blade.png");
- Since:
- 0.0.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMeshNamedImage(@NotNull @Unmodifiable Map<String, MeshImage> images) Creates an instance of aMeshNamedImagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@NotNull MeshImageResolves a texture by name and falls back toMeshImage.EMPTYwhen absent.final inthashCode()Returns a hash code value for this object.images()Returns the value of theimagesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
MeshNamedImage
Creates an instance of aMeshNamedImagerecord class.- Parameters:
images- the value for theimagesrecord component
-
-
Method Details
-
get
Resolves a texture by name and falls back toMeshImage.EMPTYwhen absent.- Parameters:
name- texture name referenced by a parsed mesh face- Returns:
- the resolved image, or
MeshImage.EMPTYwhen no texture is available - Since:
- 0.0.1
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
images
Returns the value of theimagesrecord component.- Returns:
- the value of the
imagesrecord component
-