Package net.mtrop.doom.texture
Class DoomTextureList
java.lang.Object
net.mtrop.doom.texture.CommonTextureList<DoomTextureList.Texture>
net.mtrop.doom.texture.DoomTextureList
- All Implemented Interfaces:
Iterable<DoomTextureList.Texture>
,BinaryObject
,Sizable
public class DoomTextureList
extends CommonTextureList<DoomTextureList.Texture>
implements BinaryObject
This is the lump that contains a collection of Doom-formatted textures.
All textures are stored in here, usually named TEXTURE1 or TEXTURE2 in the WAD.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This class represents a single texture entry in a TEXTURE1/TEXTURE2 lump.Nested classes/interfaces inherited from interface net.mtrop.doom.object.BinaryObject
BinaryObject.InlineScanner<BO extends BinaryObject>, BinaryObject.Reflect, BinaryObject.Scanner<BO extends BinaryObject>, BinaryObject.Shared, BinaryObject.Transformer<BO extends BinaryObject>
-
Constructor Summary
ConstructorDescriptionCreates a new TextureList with a default starting capacity.DoomTextureList
(int capacity) Creates a new TextureList with a specific starting capacity. -
Method Summary
Modifier and TypeMethodDescriptioncreateTexture
(String texture) Creates a new texture in this list with no patches, at the end of the list.void
readBytes
(InputStream in) Reads from anInputStream
and sets this object's fields.Methods inherited from class net.mtrop.doom.texture.CommonTextureList
addCreatedTexture, clear, getTextureByIndex, getTextureByName, indexOf, isEmpty, iterator, remove, removeIndex, size, sort, sort, writeBytes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.mtrop.doom.object.BinaryObject
fromBytes, readFile, toBytes, writeBytes, writeFile, writeFile
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DoomTextureList
public DoomTextureList()Creates a new TextureList with a default starting capacity. -
DoomTextureList
public DoomTextureList(int capacity) Creates a new TextureList with a specific starting capacity.- Parameters:
capacity
- the starting capacity.
-
-
Method Details
-
createTexture
Description copied from class:CommonTextureList
Creates a new texture in this list with no patches, at the end of the list.- Specified by:
createTexture
in classCommonTextureList<DoomTextureList.Texture>
- Parameters:
texture
- the name of the texture.- Returns:
- a new, empty texture object added to this list.
- See Also:
-
readBytes
Description copied from interface:BinaryObject
Reads from anInputStream
and sets this object's fields. Only reads the amount of bytes that it takes to read a single instance of the object. Note that not every object may have a consistent length!- Specified by:
readBytes
in interfaceBinaryObject
- Parameters:
in
- theInputStream
to read from.- Throws:
IOException
- if a read error occurs.
-