|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector<E>
javoids.SpriteVector<E>
E - the type of sprite being storedpublic class SpriteVector<E extends BasicSprite>
A vecotr class to hold many sprites.
| Field Summary | |
|---|---|
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
| Fields inherited from class java.util.Vector |
|---|
capacityIncrement, elementCount, elementData |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
SpriteVector(int maxParts)
|
|
| Method Summary | |
|---|---|
boolean |
add(E basicSprite)
add a sprite to this vector. |
boolean |
addAll(SpriteVector<E> sprites)
add all the sprites from another SpriteVector to this vector. |
void |
drawSprites(java.awt.Graphics2D g2d,
java.awt.Graphics2D foregroundImage)
Draw all of the sprites in this vector. |
void |
moveSprites()
move all the sprites in the vector |
void |
moveSpritesGravity(java.util.Collection<? extends BasicSprite> sprites)
Move the sprites in the vector toward/away from the sprites in another vector (if the other sprites are gravity sources). |
void |
moveSpritesHoming(java.util.Collection<? extends BasicSprite> sprites)
Move the sprites in the vector to the target sprites in another vector (if they are homing) going to the closest one. |
void |
removeDead()
Remove the dead sprites from the vector |
java.lang.String |
toString()
Provide a String representation of this object. |
| Methods inherited from class java.util.Vector |
|---|
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
iterator, listIterator, listIterator |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
iterator, listIterator, listIterator |
| Field Detail |
|---|
private static final long serialVersionUID
| Constructor Detail |
|---|
public SpriteVector(int maxParts)
maxParts - | Method Detail |
|---|
public void moveSprites()
public void moveSpritesHoming(java.util.Collection<? extends BasicSprite> sprites)
sprites - the other sprites that are targets.public void moveSpritesGravity(java.util.Collection<? extends BasicSprite> sprites)
sprites - the other sprites that are targets.public void removeDead()
public void drawSprites(java.awt.Graphics2D g2d,
java.awt.Graphics2D foregroundImage)
g2d - the graphics contextforegroundImage - the foreground image to redraw the sprites onpublic boolean add(E basicSprite)
add in interface java.util.Collection<E extends BasicSprite>add in interface java.util.List<E extends BasicSprite>add in class java.util.Vector<E extends BasicSprite>basicSprite - the sprite to add
public boolean addAll(SpriteVector<E> sprites)
sprites - the sprites to add to this vector
public java.lang.String toString()
toString in class java.util.Vector<E extends BasicSprite>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||