|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectgameComponents.SpriteDataModel
public class SpriteDataModel
This class encapsulates a data model of a collection of polka dots. Duplicate polka dots are permitted.
Constructor Summary | |
---|---|
SpriteDataModel(java.awt.Dimension dim)
Creates a collection and initialized it with the shooter sprite |
Method Summary | |
---|---|
void |
addListener(ModelListener listener)
Add a listener to this model. |
void |
fireShooter()
This method causes a firing behaviour to be shown on the display. |
java.awt.Dimension |
getDimension()
|
ShooterSprite |
getShooterSprite()
|
java.util.Collection<Sprite> |
getSprites()
Return this collection as a List of PolkaDot objects. |
void |
moveShooterDown()
Move this sprite down one "vertical unit" (the size of this unit is determined by a class attribute). |
void |
moveShooterLeft()
Move this sprite left one "horizontal unit" (the size of this unit is determined by a class attribute). |
void |
moveShooterRight()
Move this sprite right one "horizontal unit" (the size of this unit is determined by a class attribute). |
void |
moveShooterUp()
Move this sprite up one "vertical unit" (the size of this unit is determined by a class attribute). |
void |
notifyModelHasChanged()
|
void |
updateSprites()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpriteDataModel(java.awt.Dimension dim)
Method Detail |
---|
public java.awt.Dimension getDimension()
public void addListener(ModelListener listener)
listener
- public void notifyModelHasChanged()
public java.util.Collection<Sprite> getSprites()
public void fireShooter()
public ShooterSprite getShooterSprite()
public void moveShooterUp()
public void moveShooterDown()
public void moveShooterLeft()
public void moveShooterRight()
public void updateSprites()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |