gameComponents
Class SpriteDataModel

java.lang.Object
  extended by gameComponents.SpriteDataModel

public class SpriteDataModel
extends java.lang.Object

This class encapsulates a data model of a collection of polka dots. Duplicate polka dots are permitted.

Author:
mb

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

SpriteDataModel

public SpriteDataModel(java.awt.Dimension dim)
Creates a collection and initialized it with the shooter sprite

Method Detail

getDimension

public java.awt.Dimension getDimension()

addListener

public void addListener(ModelListener listener)
Add a listener to this model.

Parameters:
listener -

notifyModelHasChanged

public void notifyModelHasChanged()

getSprites

public java.util.Collection<Sprite> getSprites()
Return this collection as a List of PolkaDot objects.

Returns:
as described above

fireShooter

public void fireShooter()
This method causes a firing behaviour to be shown on the display. A projectile is fired from the tip of the shooter.


getShooterSprite

public ShooterSprite getShooterSprite()

moveShooterUp

public void moveShooterUp()
Move this sprite up one "vertical unit" (the size of this unit is determined by a class attribute).


moveShooterDown

public void moveShooterDown()
Move this sprite down one "vertical unit" (the size of this unit is determined by a class attribute).


moveShooterLeft

public void moveShooterLeft()
Move this sprite left one "horizontal unit" (the size of this unit is determined by a class attribute).


moveShooterRight

public void moveShooterRight()
Move this sprite right one "horizontal unit" (the size of this unit is determined by a class attribute).


updateSprites

public void updateSprites()