public class SpriteGroup
extends java.lang.Object
Constructor and Description |
---|
SpriteGroup(int itype)
Creates a new SpriteGroup, specifying the type of sprites this will hold.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllSprites(java.util.Collection<VGDLSprite> spritesToAdd)
Adds a collection of sprites to this collection.
|
void |
addSprite(int spriteId,
VGDLSprite sprite)
Adds an sprite to the collection.
|
void |
clear()
Clears the collection of sprites.
|
void |
copyAllSprites(java.util.Collection<VGDLSprite> spritesToCopy)
Adds a collection of sprites to this collection.
|
VGDLSprite |
getFirstSprite()
Gets the first sprite of this collection, or null if it is empty
|
int |
getItype()
Gets the type of this SpriteGroup.
|
VGDLSprite |
getSprite(int spriteId)
Retrieves a sprite given its unique ID.
|
VGDLSprite |
getSpriteByIdx(int idx)
Retrieves a sprite given its position in the sprite list.
|
java.util.Iterator<VGDLSprite> |
getSpriteIterator()
Gets an ordered iterator through all sprites.
|
java.util.ArrayList<VGDLSprite> |
getSprites()
Gets the collection of sprites, as a ConcurrentHashMap [KEY => VALUE].
|
int |
numDisabledSprites()
Returns the number of disabled sprites
|
int |
numSprites()
Gets the number of sprites in the collection.
|
void |
removeSprite(VGDLSprite sprite)
Removes an sprite.
|
public SpriteGroup(int itype)
itype
- type of sprite for the SpriteGroup.public void addSprite(int spriteId, VGDLSprite sprite)
spriteId
- Unique ID of the sprite to addsprite
- Sprite to add.public void addAllSprites(java.util.Collection<VGDLSprite> spritesToAdd)
spritesToAdd
- Sprites to add.public void copyAllSprites(java.util.Collection<VGDLSprite> spritesToCopy)
spritesToCopy
- Sprites to copy.public java.util.ArrayList<VGDLSprite> getSprites()
public java.util.Iterator<VGDLSprite> getSpriteIterator()
public void removeSprite(VGDLSprite sprite)
sprite
- the sprite to remove.public int getItype()
public VGDLSprite getSprite(int spriteId)
spriteId
- ID of the sprite to retrieve.public VGDLSprite getSpriteByIdx(int idx)
idx
- index of the sprite.public void clear()
public int numSprites()
public int numDisabledSprites()
public VGDLSprite getFirstSprite()